public static function registrationMeta() { if (Yii::$app->request->isAjax === false && !BackendModule::isBackend()) { $cacheName = Yii::$app->getModule('seo')->cacheConfig['metaCache']['name']; $cacheExpire = Yii::$app->getModule('seo')->cacheConfig['metaCache']['expire']; $metas = Yii::$app->getCache()->get($cacheName); if ($metas === false) { $metas = Meta::find()->all(); Yii::$app->getCache()->set($cacheName, $metas, $cacheExpire); } foreach ($metas as $meta) { Yii::$app->controller->getView()->registerMetaTag(['name' => $meta->name, 'content' => $meta->content], $meta->key); } } }
/** * @inheritdoc */ public function init() { parent::init(); if (!is_array($this->notifyPermissions)) { $this->notifyPermissions = explode(',', $this->notifyPermissions); foreach ($this->notifyPermissions as $key => $permission) { $this->notifyPermissions[$key] = trim($permission); } } if (!is_array($this->manageRoles)) { $this->manageRoles = explode(',', $this->manageRoles); foreach ($this->manageRoles as $key => $role) { $this->manageRoles[$key] = trim($role); } } }
</div> <div class="col-md-6 col-sm-12"> <?php BackendWidget::begin(['title' => Yii::t('app', 'Backend edit grids'), 'options' => ['class' => 'visible-header']]); ?> <?php foreach ($model->getAllBackendEditGrids() as $moduleId => $backendGrids) { ?> <?php BackendWidget::begin(['title' => Yii::t('app', $moduleId), 'options' => ['class' => 'visible-header']]); ?> <?php foreach ($backendGrids as $grid) { ?> <?php echo $form->field($model, 'backendEditGrids[' . $moduleId . '][' . $grid['key'] . ']')->dropDownList(\app\backend\BackendModule::backendGridLabels())->label($grid['label']); ?> <?php } ?> <?php BackendWidget::end(); ?> <?php } ?> <?php BackendWidget::end(); ?> </div> </div>