예제 #1
0
 /**
  * Найти тему по $id($id - это диретория с темой)
  * @param $id string
  * @return $this object
  * @throws NotFoundHttpException
  * @throws \yii\base\Exception
  */
 public function findRecordModel($id)
 {
     $config = FileHelper::requireFile(\Yii::getAlias('@themes') . '/' . $id . '/config.php');
     if ($this->load(['theme' => $config], 'theme')) {
         return $this;
     } else {
         throw new NotFoundHttpException();
     }
 }
예제 #2
0
 /**
  * Получение конфигурации текущей темы
  * */
 private function getCurrentThemeConfig()
 {
     return FileHelper::requireFile(\Yii::getAlias('@currentThemePath') . '/config.php');
 }
예제 #3
0
 /**
  * Загрузка перевода в массив JavaScript
  * */
 private function registerTranslationsInJs()
 {
     $json = Json::encode(['system' => FileHelper::requireFile(Yii::getAlias('@vendor') . '/nagser/base/messages/' . Yii::$app->language . '/js.php')]);
     Yii::$app->view->registerJs('var language = ' . $json, View::POS_HEAD);
 }