igaster\laravelTheme\Themes::url PHP Метод

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

Attach current theme's paths to a local Url. The Url must be a resource located on the asset path of the current theme or it's parents.
public url ( string $url ) : string
$url string
Результат string
    public function url($url)
    {
        if (Config::get('themes.enabled', true)) {
            // Check for valid {xxx} keys and replace them with the Theme's configuration value (in themes.php)
            preg_match_all('/\\{(.*?)\\}/', $url, $matches);
            foreach ($matches[1] as $param) {
                if (($value = $this->config($param)) !== null) {
                    $url = str_replace('{' . $param . '}', $value, $url);
                }
            }
            return $this->activeTheme->url($url);
        }
        return $url;
    }

Usage Example

Пример #1
0
 public function url()
 {
     return Themes::url($this->name);
 }