Skip to content

Miscellaneous

buttonTo()

buttonTo() — returns any

Creates a form containing a single button that submits to the URL. The URL is built the same way as the linkTo function.

NameTypeRequiredDefaultDescription
textstringyesThe text content of the button.
confirmstringyesSee documentation for linkTo.
imagestringyesIf you want to use an image for the button pass in the link to it here (relative from the images folder).
disableanyyesPass in true if you want the button to be disabled when clicked (can help prevent multiple clicks), or pass in a string if you want the button disabled and the text on the button updated (to “please wait…”, for example).
routestringyesSee documentation for URLFor.
controllerstringyesSee documentation for URLFor.
actionstringyesSee documentation for URLFor.
keyanyyesSee documentation for URLFor.
paramsstringyesSee documentation for URLFor.
anchorstringyesSee documentation for URLFor.
onlyPathbooleanyestrueSee documentation for URLFor.
hoststringyesSee documentation for URLFor.
protocolstringyesSee documentation for URLFor.
portnumericyes0See documentation for URLFor.
#buttonTo(text="Delete Account", action="perFormDelete", disable="Wait...")#

// apply attributes to the input element by prefixing any arguments with "input"
#buttonTo(text="Edit", action="edit", inputId="edit-button", inputClass="edit-button-class")#