backend/controllers/ThemeController.php
/**
     * Install selected theme and run install and uninstall action based on config.
     *
     * @param string $theme
     *
     * @return \yii\web\Response
     */
Install selected theme and run install and uninstall action based on config.
@param string $theme

@return \yii\web\Response
Install selected theme and run install and uninstall action based on config . @param string $theme @return \ yii \ web \ Response
public function actionInstall($theme)
    {
        foreach (ArrayHelper::getValue($this->getConfig(Option::get('theme')), 'uninstall', []) as $type) {
            try {
                Yii::createObject($type);
            } catch (Exception $e) {
            }
        }
        foreach (ArrayHelper::getValue($this->getConfig($theme), 'install', []) as $type) {
            try {
                Yii::createObject($type);
            } catch (Exception $e) {
            }
        }
        if (Option::set('theme', $theme)) {
            Yii::$app->getSession()->setFlash('success', Yii::t('writesdown', "Theme successfully installed."));
        }
        return $this->redirect(['index']);
    }
public function actionInstall ( $ theme ) { foreach ( ArrayHelper :: getValue ( $ this -> getConfig ( Option :: get ( 'theme' ) ) , 'uninstall' , [ ] ) as $ type ) { try { Yii :: createObject ( $ type ) ; } catch ( Exception $ e ) { } } foreach ( ArrayHelper :: getValue ( $ this -> getConfig ( $ theme ) , 'install' , [ ] ) as $ type ) { try { Yii :: createObject ( $ type ) ; } catch ( Exception $ e ) { } } if ( Option :: set ( 'theme' , $ theme ) ) { Yii :: $ app -> getSession ( ) -> setFlash ( 'success' , Yii :: t ( 'writesdown' , " Theme successfully installed. " ) ) ; } return $ this -> redirect ( [ 'index' ] ) ; }
Install selected theme and run install and uninstall action based on config.
Install selected theme and run install and uninstall action based on config .