css()
Creates one or multiple CSS link tags
Parameters
Name | Type | Default | Description |
---|---|---|---|
$url * | string |array |
– | Relative or absolute URLs, an array of URLs or @auto for automatic template css loading |
$options | string |array |
null |
Pass an array of attributes for the link tag or a media attribute string |
Return type
string
|null
Example
Creating a single link tag
Creating multiple link tags
Autoloading template specific css files
Template specific css files must be located in /assets/css/templates
and named like the template.
Template | CSS file |
---|---|
/site/templates/project.php | /assets/css/templates/project.css |
/site/templates/home.php | /assets/css/templates/home.css |
/site/templates/blog.php | /assets/css/templates/blog.css |
Media attribute
You can also specify a media attribute for the link tags:
Other attributes
You can also pass an array of completely custom attributes:
For the rel
attribute only alternate stylesheet
is a valid value, and only if also passing a title
attribute: