View Helpers
styleSheetLinkTag()
Signature
Section titled “Signature”styleSheetLinkTag() — returns string
Available in: controller
Category: Asset Functions
Description
Section titled “Description”Returns a link tag for a stylesheet (or several) based on the supplied arguments.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
sources | string | no | — | The name of one or many CSS files in the stylesheets folder, minus the .css extension. Pass a full URL to generate a tag for an external style sheet. Can also be called with the source argument. |
type | string | no | text/css | The type attribute for the link tag. |
media | string | no | all | The media attribute for the link tag. |
head | boolean | no | false | Set to true to place the output in the head area of the HTML page instead of the default behavior (which is to place the output where the function is called from). |
delim | string | no | , | The delimiter to use for the list of CSS files. |
encode | boolean | no | true | When set to true, encodes tag content, attribute values, and URLs so that Cross Site Scripting (XSS) attacks can be prevented. Set to attributes to only encode attribute values and not tag content. |
Examples
Section titled “Examples”<!--- view code --->
<head>
<!--- Includes `stylesheets/styles.css` --->
#styleSheetLinkTag("styles")#
<!--- Includes `stylesheets/blog.css` and `stylesheets/comments.css` --->
#styleSheetLinkTag("blog,comments")#
<!--- Includes printer style sheet --->
#styleSheetLinkTag(source="print", media="print")#
<!--- Includes external style sheet --->
#styleSheetLinkTag("http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/cupertino/jquery-ui.css")#
</head>
<body>
<!--- This will still appear in the `head` --->
#styleSheetLinkTag(source="tabs", head=true)#
</body>