public function __construct() { parent::__construct(); self::isLogin(); @($pageNums = getConfig('PAGENUM')); $this->pageNum = !empty($pageNums) ? $pageNums : 11; $this->assign(array('APP' => APP, 'user' => $_SESSION['user'])); }
public function render() { if ($this->getUser()) { if ($this->getActionView()) { $this->getActionView()->set('user', $this->getUser()); } if ($this->getLayoutView()) { $this->getLayoutView()->set('user', $this->getUser()); } } parent::render(); }
public function __construct() { parent::__construct(); //获取配置文件中的分页数 @($pageNums = getConfig('PAGENUM')); $this->pageNum = !empty($pageNums) ? $pageNums : 11; //输出导航信息 $this->getNav(); $this->getTag(); $this->getHotArticle(); $this->getLink(); }
public function __construct() { parent::__construct(); if ($this->checkMobile()) { $this->theme = 'mobile'; $this->mobile = true; } $this->assign('pageTitle', $this->pageTitle); $this->assign('pageKeywords', $this->pageKeywords); $this->assign('pageDescription', $this->pageDescription); //获取blog配置缓存 $setting = $this->setting(); $this->assign('setting', $setting); }
/** * Checks whether the user is set and then assign it to both the layout and action views. */ public function render() { /* if the user and view(s) are defined, * assign the user session to the view(s) */ if ($this->user) { if ($this->actionView) { $key = "user"; if ($this->actionView->get($key, false)) { $key = "__user"; } $this->actionView->set($key, $this->user); } if ($this->layoutView) { $key = "user"; if ($this->layoutView->get($key, false)) { $key = "__user"; } $this->layoutView->set($key, $this->user); } } parent::render(); }
public function __construct($options = array()) { parent::__construct($options); $database = Registry::get("database"); $database->connect(); }
/** * Override \Framework\Controller\render() and * assign the $_user to both action and layout views * @return void */ public function render() { if ($this->user) { if ($this->actionView) { $key = "user"; if ($this->actionView->get($key, false)) { $key = "__user"; } $this->actionView->set($key, $this->user); } if ($this->layoutView) { $key = "user"; if ($this->layoutView->get($key, false)) { $key = "__user"; } $this->layoutView->set($key, $this->user); } } // If the request was not XHR then render the view if (!$this->ajax) { parent::render(); } }
function __construct(View $view, $config) { parent::__construct($view, $config); $this->_employeeManager = new EmployeeManager($this->config); $this->_ratesManager = new RatesManager(); }
/** * Checks whether the user is set and then assign it to both the layout and action views. */ public function render() { /* if the user and view(s) are defined, * assign the user session to the view(s) */ $session = Registry::get("session"); $tracks = $session->get('User:$pListTracks'); $current = $session->get('Users:$currentPlaylist'); $playlists = $session->get('User:$playlists'); if ($this->user) { if ($this->actionView) { $key = "user"; if ($this->actionView->get($key, false)) { $key = "__user"; } $this->actionView->set($key, $this->user); if ($tracks) { $this->actionView->set('current', $current); $this->actionView->set('playlists', $playlists); $this->actionView->set('plistTracks', $tracks); } } if ($this->layoutView) { $key = "user"; if ($this->layoutView->get($key, false)) { $key = "__user"; } $this->layoutView->set($key, $this->user); if ($tracks) { $this->layoutView->set('current', $current); $this->layoutView->set('playlists', $playlists); $this->layoutView->set('plistTracks', $tracks); } } } parent::render(); }
public function __destruct() { $view = $this->layoutView; if ($view && !$view->get('seo')) { $view->set('seo', \Framework\Registry::get("seo")); } parent::__destruct(); }