Grails : Tag - createLink
This page last changed on Mar 09, 2006 by [email protected].
Tag - createLinkDescriptionCreates a link that can be used where necessary (for example in an href, javascript, ajax call etc.) Parameters
ExamplesExample controller for an application called "shop": BookController.groovy class BookController {
@Property defaultAction="list"
@Property list = { [ books: Book.list( params ) ] }
@Property show = { [ book : Book.get( params['id'] ) ] }
}
Example usages for above controller: <g:createLink action="show" id="1" /> == /shop/book/show/1 <g:createLink controller="book" /> == /shop/book <g:createLink controller="book" action="list" /> == /shop/book/list <g:createLink url="[action:'list',controller:'book']" /> == /shop/book/list Example as a method call in GSP only: <a href="${createLink(action:'list')}">my link</a> Results in: <a href="/shop/book/list">my link</a> |
Document generated by Confluence on Mar 29, 2006 08:46 |