View Helpers
autoLink()
Signature
Section titled “Signature”autoLink() — returns string
Available in: controller
Category: Link Functions
Description
Section titled “Description”Turns all URLs and email addresses into links.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | yes | — | The text to create links in. |
link | string | no | all | Whether to link URLs, email addresses or both. Possible values are: all (default), URLs and emailAddresses. |
relative | boolean | no | true | Should we auto-link relative urls. |
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”<!--- Will output: Download CFWheels from <a href="http://cfwheels.org/download">http://cfwheels.org/download</a> --->
#autoLink("Download CFWheels from http://cfwheels.org/download")#
<!--- Will output: Email us at <a href="mailto:info@cfwheels.org">info@cfwheels.org</a> --->
#autoLink("Email us at info@cfwheels.org")#