init() публичный Метод

Функция инициализации контроллера:
public init ( ) : void
Результат void
Пример #1
0
 /**
  * Вызывается при инициализации FrontController
  * Присваивает значения, необходимым переменным
  */
 public function init()
 {
     parent::init();
     $this->pageTitle = $this->yupe->siteName;
     $this->metaTitle = $this->yupe->siteName;
     $this->description = $this->yupe->siteDescription;
     $this->keywords = $this->yupe->siteKeyWords;
     Yii::app()->theme = $this->yupe->theme ?: 'default';
     if (!Yii::app()->getRequest()->getIsAjaxRequest()) {
         $bootstrap = Yii::app()->getTheme()->getBasePath() . DIRECTORY_SEPARATOR . "bootstrap.php";
         if (is_file($bootstrap)) {
             require $bootstrap;
         }
     }
 }
Пример #2
0
 public function init()
 {
     parent::init();
     $this->yupe->getComponent('bootstrap');
     $this->layout = $this->yupe->getBackendLayoutAlias();
     $backendTheme = $this->yupe->backendTheme;
     $this->setPageTitle(Yii::t('YupeModule.yupe', 'Yupe control panel!'));
     if ($backendTheme && is_dir(Yii::getPathOfAlias("webroot.themes.backend_" . $backendTheme))) {
         Yii::app()->theme = "backend_" . $backendTheme;
     } else {
         Yii::app()->theme = "default";
         if (!$this->yupe->enableAssets) {
             return;
         }
     }
 }
Пример #3
0
 /**
  * Вызывается при инициализации FrontController
  * Присваивает значения, необходимым переменным
  */
 public function init()
 {
     parent::init();
     $this->pageTitle = $this->yupe->siteName;
     $this->description = $this->yupe->siteDescription;
     $this->keywords = $this->yupe->siteKeyWords;
     if ($this->yupe->theme) {
         Yii::app()->theme = $this->yupe->theme;
         $bootstrap = Yii::app()->theme->basePath . DIRECTORY_SEPARATOR . "bootstrap.php";
         if (is_file($bootstrap)) {
             require $bootstrap;
         }
     } else {
         Yii::app()->theme = 'default';
     }
 }