Xpressengine\Presenter\Html\Tags\CSSFile::render PHP Method

render() public method

render
public render ( string $file, boolean | false $minified = false ) : string
$file string file path
$minified boolean | false minified
return string
    public function render($file, $minified = false)
    {
        //attr
        $attr = '';
        if (count($this->attributes) > 0) {
            foreach ($this->attributes as $name => $value) {
                $attr .= ' ' . $name . '="' . $value . '"';
            }
        }
        if ($minified && $this->minified !== null) {
            $file = $this->minified;
        }
        // src
        $tag = '<link href="' . $file . '"' . $attr . '>' . PHP_EOL;
        // target
        if ($this->target !== null) {
            $targetTag = '<!--[if ' . $this->target . ']>';
            if (stripos($this->target, 'gt') === 0) {
                $targetTag .= '<!-->;';
            }
            $tag = $targetTag . $tag . '<![endif]-->';
        }
        return $tag;
    }