Habari\Theme::load_assets PHP Метод

load_assets() публичный Метод

Load and return a list of all assets in the current theme chain's /assets/ directory
public load_assets ( boolean $refresh = false ) : array
$refresh boolean If True, clear and reload all assets
Результат array An array of URLs of assets in the assets directories of the active theme chain
    public function load_assets($refresh = false)
    {
        static $assets = null;
        if (is_null($assets) || $refresh) {
            $themedirs = $this->theme_dir;
            $assets = array('css' => array(), 'js' => array());
            foreach ($themedirs as $dir) {
                if (file_exists(Utils::end_in_slash($dir) . 'assets')) {
                    $theme_assets = Utils::glob(Utils::end_in_slash($dir) . 'assets/*.*');
                    foreach ($theme_assets as $asset) {
                        $extension = strtolower(substr($asset, strrpos($asset, '.') + 1));
                        $assets[$extension][basename($asset)] = $this->dir_to_url($asset);
                    }
                }
            }
        }
        return $assets;
    }