public function __construct($request, $response, $params = NULL) { parent::__construct($request, $response, $params); $this->parameter->setDefault(array('type' => NULL)); /** 用于判断是路由调用还是外部调用 */ if (NULL == $this->parameter->type) { $this->parameter->type = Typecho_Router::$current; } else { $this->_invokeFromOutside = true; } }
public function __construct($request, $response, $params = NULL) { parent::__construct($request, $response, $params); $this->_themeDir = rtrim($this->options->themeFile($this->options->theme), '/') . '/'; /** 初始化皮肤函数 */ $functionsFile = $this->_themeDir . 'functions.php'; if (file_exists($functionsFile)) { require_once $functionsFile; if (function_exists('themeInit')) { themeInit($this); } } }
public function render() { if (empty($this->token)) { $this->setMetaTitle('通过电子邮件重设密码'); if ($this->user->hasLogin()) { $this->response->redirect($this->___settingUrl()); } parent::render('user/forgot.php'); } else { $this->setMetaTitle('重设密码'); parent::render('user/forgot_reset.php'); } }
public function render() { $this->current = 'login'; /** 如果已经登录 */ if ($this->user->hasLogin()) { /** 直接返回 */ $this->response->redirect($this->options->index); } if ($this->request->isPost() || $this->request->isAjax()) { $this->doLogin(); } else { $this->setMetaTitle('登录'); parent::render('user/login.php'); } }
public function render() { $this->current = 'register'; // 如果已经登录 if ($this->user->hasLogin()) { // 直接返回首页 $this->response->redirect($this->options->index); } if ($this->request->isPost() || $this->request->isAjax()) { $this->doRegister(); } else { $this->_metaTitle = '注册'; parent::render('user/register.php'); } }
public function __construct($request, $response, $params = NULL) { parent::__construct($request, $response, $params); }
public function avatar() { $this->setMetaTitle('设置头像'); parent::render('user/setting_avatar.php'); }