backend/controllers/ThemeController.php
/**
     * Scan theme directory to get list of all available themes.
     *
     * @return string
     */
Scan theme directory to get list of all available themes.
@return string
Scan theme directory to get list of all available themes . @return string
public function actionIndex()
    {
        $installed = Option::get('theme');
        $themes[] = $this->getConfig($installed);
        if (!is_dir($this->_dir)) {
            FileHelper::createDirectory($this->_dir, 0755);
        }
        if (!is_dir($this->_thumbDir)) {
            FileHelper::createDirectory($this->_thumbDir, 0755);
        }
        $arrThemes = scandir($this->_dir);
        foreach ($arrThemes as $theme) {
            if (is_dir($this->_dir . $theme) && $theme !== '.' && $theme !== '..' && $theme !== $installed) {
                $themes[] = $this->getConfig($theme);
            }
        }
        return $this->render('index', [
            'themes'    => $themes,
            'installed' => $installed,
        ]);
    }
public function actionIndex ( ) { $ installed = Option :: get ( 'theme' ) ; $ themes [ ] = $ this -> getConfig ( $ installed ) ; if ( ! is_dir ( $ this -> _dir ) ) { FileHelper :: createDirectory ( $ this -> _dir , 0755 ) ; } if ( ! is_dir ( $ this -> _thumbDir ) ) { FileHelper :: createDirectory ( $ this -> _thumbDir , 0755 ) ; } $ arrThemes = scandir ( $ this -> _dir ) ; foreach ( $ arrThemes as $ theme ) { if ( is_dir ( $ this -> _dir . $ theme ) && $ theme !== '.' && $ theme !== '..' && $ theme !== $ installed ) { $ themes [ ] = $ this -> getConfig ( $ theme ) ; } } return $ this -> render ( 'index' , [ 'themes' => $ themes , 'installed' => $ installed , ] ) ; }
Scan theme directory to get list of all available themes.
Scan theme directory to get list of all available themes .