HeadModule::addCss PHP Method

addCss() public method

Adds a "link" tag to the head containing a reference to a stylesheet.
public addCss ( string $HRef, string $Media = '', boolean $AddVersion = true, array $Options = null )
$HRef string Location of the stylesheet relative to the web root (if an absolute path with http:// is provided, it will use the HRef as provided). ie. /themes/default/css/layout.css or http://url.com/layout.css
$Media string Type media for the stylesheet. ie. "screen", "print", etc.
$AddVersion boolean Whether to append version number as query string.
$Options array Additional properties to pass to AddTag, e.g. 'ie' => 'lt IE 7';
        public function addCss($HRef, $Media = '', $AddVersion = true, $Options = null)
        {
            $Properties = array('rel' => 'stylesheet', 'href' => Asset($HRef, false, $AddVersion), 'media' => $Media);
            // Use same underscore convention as AddScript
            if (is_array($Options)) {
                foreach ($Options as $Key => $Value) {
                    $Properties['_' . strtolower($Key)] = $Value;
                }
            }
            $this->addTag('link', $Properties);
        }