yii\helpers\BaseHtml::cssFile PHP Метод

cssFile() публичный статический Метод

Generates a link tag that refers to an external CSS file.
См. также: Url::to()
public static cssFile ( array | string $url, array $options = [] ) : string
$url array | string the URL of the external CSS file. This parameter will be processed by [[Url::to()]].
$options array the tag options in terms of name-value pairs. The following options are specially handled: - condition: specifies the conditional comments for IE, e.g., `lt IE 9`. When this is specified, the generated `link` tag will be enclosed within the conditional comments. This is mainly useful for supporting old versions of IE browsers. - noscript: if set to true, `link` tag will be wrapped into `
Результат string the generated link tag
    public static function cssFile($url, $options = [])
    {
        if (!isset($options['rel'])) {
            $options['rel'] = 'stylesheet';
        }
        $options['href'] = Url::to($url);
        if (isset($options['condition'])) {
            $condition = $options['condition'];
            unset($options['condition']);
            return self::wrapIntoCondition(static::tag('link', '', $options), $condition);
        } elseif (isset($options['noscript']) && $options['noscript'] === true) {
            unset($options['noscript']);
            return '<noscript>' . static::tag('link', '', $options) . '</noscript>';
        } else {
            return static::tag('link', '', $options);
        }
    }