fetchModuleSettings() public static method

public static fetchModuleSettings ( $moduleId, array $params = null ) : array
$moduleId
$params array
return array
示例#1
0
 /**
  * Экшен настроек темы:
  *
  * @return void
  **/
 public function actionThemesettings()
 {
     if (Yii::app()->getRequest()->getIsPostRequest()) {
         if ($this->saveParamsSetting($this->yupe->coreModuleId, ['theme', 'backendTheme'])) {
             Yii::app()->getUser()->setFlash(yupe\widgets\YFlashMessages::SUCCESS_MESSAGE, Yii::t('YupeModule.yupe', 'Themes settings saved successfully!'));
             Yii::app()->getCache()->clear('yupe');
         } else {
             Yii::app()->getUser()->setFlash(yupe\widgets\YFlashMessages::ERROR_MESSAGE, Yii::t('YupeModule.yupe', 'There is an error when saving settings!'));
         }
         $this->redirect(['/yupe/backend/themesettings/']);
     }
     $settings = Settings::fetchModuleSettings('yupe', ['theme', 'backendTheme']);
     $noThemeValue = Yii::t('YupeModule.yupe', 'Theme is don\'t use');
     $theme = isset($settings['theme']) && $settings['theme']->param_value != '' ? $settings['theme']->param_value : $noThemeValue;
     $backendTheme = isset($settings['backendTheme']) && $settings['backendTheme']->param_value != '' ? $settings['backendTheme']->param_value : $noThemeValue;
     $this->render('themesettings', ['themes' => $this->yupe->getThemes(), 'theme' => $theme, 'backendThemes' => $this->yupe->getThemes(true), 'backendTheme' => $backendTheme]);
 }