Exemplo n.º 1
0
 public function init()
 {
     parent::init();
     Common::setTimezone();
 }
Exemplo n.º 2
0
 public function init()
 {
     parent::init();
     $this->name = self::getSiteName();
 }
Exemplo n.º 3
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     //$this->initI18N();
     //$this->bootstrap = array_merge($this->bootstrap, ['main']);
     parent::init();
     $this->_modulesConfigDependency = new ExpressionDependency(['expression' => '\\Yii::$app->getModulesHash()']);
     DbState::bootstrap();
     Yii::$container->set('gromver\\models\\fields\\EditorField', ['controller' => 'media/manager', 'editorOptions' => ['filebrowserBrowseUrl' => ['/menu/backend/item/ckeditor-select'], 'autoGrow_onStartup' => true, 'autoGrow_bottomSpace' => 50]]);
     Yii::$container->set('gromver\\models\\fields\\MediaField', ['controller' => 'media/manager']);
     Yii::$container->set('gromver\\modulequery\\ModuleQuery', ['cache' => $this->cache, 'cacheDependency' => $this->_modulesConfigDependency]);
     Yii::$container->set('gromver\\platform\\core\\components\\MenuMap', ['cache' => $this->cache, 'cacheDependency' => DbState::dependency(MenuItem::tableName())]);
     Yii::$container->set('gromver\\platform\\core\\components\\MenuUrlRule', ['cache' => $this->cache, 'cacheDependency' => $this->_modulesConfigDependency]);
     Yii::$container->set('gromver\\platform\\core\\modules\\main\\widgets\\Desktop', ['cache' => $this->cache, 'cacheDependency' => $this->_modulesConfigDependency]);
     Yii::$container->set('gromver\\platform\\core\\components\\ParamsManager', ['cache' => $this->cache, 'cacheDependency' => $this->_modulesConfigDependency]);
     $this->urlManager->addRules($this->defaultUrlRules);
     $this->set('menuManager', \Yii::createObject(MenuManager::className()));
     // пропускаем \gromver\models\fields\events\ListItemsEvent событие, через ModuleEvent - не факт, что нужно, но почему бы и нет
     Event::on('\\gromver\\models\\fields\\ListField', 'fetchItems', function ($event) {
         /** @var $event \gromver\models\fields\events\ListItemsEvent */
         $additionalItems = @$this->listFieldItems[$event->model->getSourceClass() . '::' . $event->attribute];
         if (is_array($additionalItems)) {
             $event->items = array_merge($event->items, $additionalItems);
         }
     });
     $this->applyDefaultMetadata();
 }
Exemplo n.º 4
0
 public function init()
 {
     parent::init();
     $this->setLayoutPath("{$this->getViewPath()}/_layouts");
 }
Exemplo n.º 5
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->bootstrap = array_merge($this->bootstrap, ['grom']);
     parent::init();
 }