Helpers::AssetTagHelper::stylesheet_link_tag
stylesheet_link_tag( string $source, [string $source, ...], [array $options = array()] )
Description
Returns a css link tag per source given as argument.
$source a string which is the stylesheet's "href". There a can be as many sources as desired each being a function parameter. No matter how many parameters of sources if the last parameter is an array it will be read in as options for the stylesheet tag.
The "href" can be supplied as a...
- full path, like "/my_styles/mystyle.css"
- file name, like "random.style", that gets expanded to "/stylesheets/random.styles"
- file name without extension, like "style", that gets expanded to "/stylesheets/style.css"
$options is an array of key => value pairs of options for the stylesheet tag.
Returns a stylesheet tag converting the $options into html options on the tag.
Examples
Code:
<?= stylesheet_link_tag("style") ?>
Output:
<link href="/stylesheets/style.css" media="screen" rel="Stylesheet" type="text/css" />
Code:
<?= stylesheet_link_tag("style", array("media" => "all")) ?>
Output:
<link href="/stylesheets/style.css" media="all" rel="Stylesheet" type="text/css" />
Code:
<?= stylesheet_link_tag("random.styles", "/css/stylish") ?>
Output:
<link href="/stylesheets/random.styles" media="screen" rel="Stylesheet" type="text/css" />
<link href="/css/stylish.css" media="screen" rel="Stylesheet" type="text/css" />

