Stolz\Assets\Manager::css PHP Метод

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

Accepts an array of $attributes for the HTML tag. You can take control of the tag rendering by providing a closure that will receive an array of assets.
public css ( array | Closur\Closure $attributes = null ) : string
$attributes array | Closur\Closure
Результат string
    public function css($attributes = null)
    {
        if (!$this->css) {
            return '';
        }
        $assets = $this->pipeline ? array($this->cssPipeline()) : $this->css;
        if ($attributes instanceof Closure) {
            return $attributes->__invoke($assets);
        }
        // Build attributes
        $attributes = (array) $attributes;
        unset($attributes['href']);
        if (!array_key_exists('type', $attributes)) {
            $attributes['type'] = 'text/css';
        }
        if (!array_key_exists('rel', $attributes)) {
            $attributes['rel'] = 'stylesheet';
        }
        $attributes = $this->buildTagAttributes($attributes);
        // Build tags
        $output = '';
        foreach ($assets as $asset) {
            $output .= '<link href="' . $asset . '"' . $attributes . " />\n";
        }
        return $output;
    }