/** * Get response status header string */ public static function getHeader($scheme = 'HTTP/1.1', $code = 200) { $scheme = strtoupper(Sanitize::toText($scheme)); $code = Sanitize::toNumber($code); $info = self::getString($code); return $scheme . ' ' . $code . ' ' . $info; }
/** * Sets the content type */ public function setContentType($value = '') { $value = Sanitize::toText($value); if (!empty($value)) { $this->ctype = strtolower($value); } }
/** * Sets current working table name */ public function setTable($table = '') { if (!empty($table) && is_string($table)) { $this->_table = Sanitize::toText($table); } $this->reset(); }
/** * Add a new flash message to the list for $key */ public function setFlash($key = '', $class = '', $message = '') { if (!empty($key) && is_string($key)) { $class = Sanitize::toText($class); $message = Sanitize::toText($message); $key = $this->fkey . '.' . $key; $list = $this->session->get($key, array()); $list[] = array('class' => $class, 'message' => $message, 'addtime' => time()); $this->session->set($key, $list); } }
/** * Set a table option */ public function setOption($key = '', $value = '', $wrap = false) { $local = Sanitize::toKey($key); $key = Sanitize::toText($key); $value = Sanitize::toText($value); if (!empty($key) && !empty($value)) { if (!empty($wrap)) { $value = "'" . addslashes(stripslashes($value)) . "'"; } $this->options[$local] = $key . "=" . $value; } return $this; }
/** * Checks if a SERVER key is available, or use default value */ private static function _server($key = '', $default = '') { $key = strtoupper(trim($key)); $default = trim($default); if (array_key_exists($key, $_SERVER)) { return Sanitize::toText($_SERVER[$key]); } return $default; }
/** * Sets the error message string */ public function setErrorMessage($value = '') { if (!empty($value) && is_string($value)) { $this->_error_message = str_replace('\\', '/', Sanitize::toText($value)); } }