Skip to content

View Helpers

autoLink()

autoLink() — returns string

Available in: controller Category: Link Functions

Turns all URLs and email addresses into links.

NameTypeRequiredDefaultDescription
textstringyesThe text to create links in.
linkstringnoallWhether to link URLs, email addresses or both. Possible values are: all (default), URLs and emailAddresses.
relativebooleannotrueShould we auto-link relative urls.
encodebooleannotrueWhen 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.
<!--- 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")#