Return to v2.1 docs


View Helpers Asset Functions string controller

Returns a link tag for a stylesheet (or several) based on the supplied arguments.

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.
rel string No The rel attribute for the relation between the tag and href.
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 Use this argument to decide whether the output of the function should be encoded in order to prevent Cross Site Scripting (XSS) attacks. Set it to true to encode all relevant output for the specific HTML element in question (e.g. tag content, attribute values, and URLs). For HTML elements that have both tag content and attribute values you can set this argument to attributes to only encode attribute values and not tag content.
<!--- view code --->
<!--- Includes `stylesheets/styles.css` --->
<!--- Includes `stylesheets/blog.css` and `stylesheets/comments.css` --->
<!--- Includes printer style sheet --->
#styleSheetLinkTag(sources="print", media="print")#
<!--- Includes external style sheet --->
<!--- This will still appear in the `head` --->
#styleSheetLinkTag(sources="tabs", head=true)#

Related Functions

Asset Functions