public function __construct() { parent::__construct(); // 要先启动父类的构造函数 if ($_SESSION['user'] == "") { $this->jump(spUrl('main', 'login')); } }
public function __construct() { global $__action; if ($__action != 'login') { if (!isset($_SESSION['codeBuilder_admin']) || !$_SESSION['codeBuilder_admin']) { $this->jump(spUrl('CodeBuilder', 'login')); } } parent::__construct(); }
/** * * T * * 多语言实现,翻译函数 * * @param w 默认语言的词语 * */ function T($w) { $method = $GLOBALS['G_SP']["lang"][spController::getLang()]; if (!isset($method) || 'default' == $method) { return $w; } elseif (function_exists($method)) { return ($tmp = call_user_func($method, $w)) ? $tmp : $w; } elseif (is_array($method)) { return ($tmp = spClass($method[0])->{$method[1]}($w)) ? $tmp : $w; } elseif (file_exists($method)) { $dict = (require $method); return isset($dict[$w]) ? $dict[$w] : $w; } else { return $w; } }
public function __destruct() { parent::__destruct(); // 这是必须的 }
public function __construct() { parent::__construct(); }
function __construct($str = '', $errno = null) { parent::__construct(); // 这是必须的 $this->Message($str, $errno); }