// generates "/shop/css/main.css"
<g:createLinkTo dir="css" file="main.css" />
// generates "http://portal.mygreatsite.com/css/main.css"
<g:createLinkTo dir="css" file="main.css" absolute="true"/>
// generates "http://admin.mygreatsite.com/css/main.css"
<g:createLinkTo dir="css" file="main.css" base="http://admin.mygreatsite.com"/>createLinkTo
| Deprecated: Use resource instead. | 
Purpose
Creates a link that can be used where necessary (for example in an href, JavaScript, Ajax call etc.)
Examples
Example controller for an application called "shop":
Example usages for the "shop" app:
Example as a method call in GSP only:
<link type="text/css" href="${createLinkTo(dir:'css',file:'main.css')}" />Results in:
<link type="text/css" href="/shop/css/main.css" />Description
Attributes
- 
dir(optional) - the name of the directory containing the resource
- 
file(optional) - the name of the resource file
- 
absolute(optional) - Iftruewill prefix the link target address with the value of thegrails.serverURLproperty fromapplication.groovy, or http://localhost:<port> if there is no setting inapplication.groovyand not running in production.
- 
base(optional) - Sets the prefix to be added to the link target address, typically an absolute server URL. This overrides the behaviour of theabsoluteproperty if both are specified.