public function theme(string $key, bool $override = true)
    {
        $result = null;
        $keys   = explode('.', $key);
        $theme  = $this->theme_setting;

        // Get theme value that defined by user
        if ($override && isset($this->config->theme[$this->env('theme')])) {
            $break = false;
            $theme = $this->config->theme[$this->env('theme')];
            foreach ($keys as $key) {
                if (isset($theme[$key])) {
                    $theme = $theme[$key];
                } else {
                    $break = true;
                    break;
                }
            }
            if (!$break) {
                $result = $theme;
            }
        }

        // If not setted by user, get theme value that defined by source theme
        if (!isset($result)) {
            $break = false;
            $theme  = $this->theme_setting;
            foreach ($keys as $key) {
                if (isset($theme[$key])) {
                    $theme = $theme[$key];
                } else {
                    $break = true;
                    break;
                }
            }
            if (!$break) {
                $result = $theme;
            }
        }
        return $result;
    }
public function theme(string $key, bool $override = true)
    {
        $result = null;
        $keys   = explode('.', $key);
        $theme  = $this->theme_setting;

        // Get theme value that defined by user
        if ($override && isset($this->config->theme[$this->env('theme')])) {
            $break = false;
            $theme = $this->config->theme[$this->env('theme')];
            foreach ($keys as $key) {
                if (isset($theme[$key])) {
                    $theme = $theme[$key];
                } else {
                    $break = true;
                    break;
                }
            }
            if (!$break) {
                $result = $theme;
            }
        }

        // If not setted by user, get theme value that defined by source theme
        if (!isset($result)) {
            $break = false;
            $theme  = $this->theme_setting;
            foreach ($keys as $key) {
                if (isset($theme[$key])) {
                    $theme = $theme[$key];
                } else {
                    $break = true;
                    break;
                }
            }
            if (!$break) {
                $result = $theme;
            }
        }
        return $result;
    }
public function theme ( string $ key , bool $ override = true ) { $ result = null ; $ keys = explode ( '.' , $ key ) ; $ theme = $ this -> theme_setting ; // Get theme value that defined by user if ( $ override && isset ( $ this -> config -> theme [ $ this -> env ( 'theme' ) ] ) ) { $ break = false ; $ theme = $ this -> config -> theme [ $ this -> env ( 'theme' ) ] ; foreach ( $ keys as $ key ) { if ( isset ( $ theme [ $ key ] ) ) { $ theme = $ theme [ $ key ] ; } else { $ break = true ; break ; } } if ( ! $ break ) { $ result = $ theme ; } } // If not setted by user, get theme value that defined by source theme if ( ! isset ( $ result ) ) { $ break = false ; $ theme = $ this -> theme_setting ; foreach ( $ keys as $ key ) { if ( isset ( $ theme [ $ key ] ) ) { $ theme = $ theme [ $ key ] ; } else { $ break = true ; break ; } } if ( ! $ break ) { $ result = $ theme ; } } return $ result ; }
get user's theme config or theme config
@param  string $key
@param  boolean $override
@return mixed
get user s theme config or theme config