stringbutton_to($name, $internal_uri, $options)
Creates an <input> button tag of the given name pointing to a routed URL
stringform_tag($url_for_options, $options)
Returns an HTML <form> tag that points to a valid action, route or URL as defined by <i>$url_for_options</i>.
Creates an <input> button tag of the given name pointing to a routed URL
based on the module/action passed as argument and the routing configuration.
The syntax is similar to the one of link_to.
Options: - 'absolute' - if set to true, the helper outputs an absolute URL
- 'query_string' - to append a query string (starting by ?) to the routed url
- 'anchor' - to append an anchor (starting by #) to the routed url
- 'confirm' - displays a javascript confirmation alert when the button is clicked
- 'popup' - if set to true, the button opens a new browser window
- 'post' - if set to true, the button submits a POST request instead of GET (caution: do not use inside a form)
Examples: echo button_to('Delete this page', 'my_module/my_action');
=>
Returns an HTML <form> tag that points to a valid action, route or URL as defined by <i>$url_for_options</i>.
By default, the form tag is generated in POST format, but can easily be configured along with any additional
HTML parameters via the optional $options parameter. If you are using file uploads, be sure to set the
multipart option to true.
Options: - multipart - When set to true, enctype is set to "multipart/form-data".
Creates a <a> link tag of the given name using a routed URL
based on the module/action passed as argument and the routing configuration.
It's also possible to pass a string instead of a module/action pair to
get a link tag that just points without consideration.
If null is passed as a name, the link itself will become the name.
If an object is passed as a name, the object string representation is used.
One of the options serves for for creating javascript confirm alerts where
if you pass 'confirm' => 'Are you sure?', the link will be guarded
with a JS popup asking that question. If the user accepts, the link is processed,
otherwise not.
Options: - 'absolute' - if set to true, the helper outputs an absolute URL
- 'query_string' - to append a query string (starting by ?) to the routed url
- 'anchor' - to append an anchor (starting by #) to the routed url
- 'confirm' - displays a javascript confirmation alert when the link is clicked
- 'popup' - if set to true, the link opens a new browser window
- 'post' - if set to true, the link submits a POST request instead of GET (caution: do not use inside a form)
- 'method' - if set to post, delete, or put, the link submits a request with the given HTTP method instead of GET (caution: do not use inside a form)
Note: The 'popup', 'post', and 'method' options are not compatible with each other.
Examples: echo link_to('Delete this page', 'my_module/my_action');
=> Delete this page echo link_to('Visit Hoogle', 'http://www.hoogle.com');
=> Visit Hoogle echo link_to('Delete this page', 'my_module/my_action', array('id' => 'myid', 'confirm' => 'Are you sure?', 'absolute' => true));
=> Delete this page
Options: - 'tag' - the HTML tag that must enclose the name if the condition is false, defaults to - 'absolute' - if set to true, the helper outputs an absolute URL
- 'query_string' - to append a query string (starting by ?) to the routed url
- 'anchor' - to append an anchor (starting by #) to the routed url
- 'confirm' - displays a javascript confirmation alert when the link is clicked
- 'popup' - if set to true, the link opens a new browser window
- 'post' - if set to true, the link submits a POST request instead of GET (caution: do not use inside a form)
Examples: echo link_to_if($user->isAdministrator(), 'Delete this page', 'my_module/my_action');
=> Delete this page echo link_to_if(!$user->isAdministrator(), 'Delete this page', 'my_module/my_action');
=> Delete this page
Options: - 'tag' - the HTML tag that must enclose the name if the condition is true, defaults to - 'absolute' - if set to true, the helper outputs an absolute URL
- 'query_string' - to append a query string (starting by ?) to the routed url
- 'anchor' - to append an anchor (starting by #) to the routed url
- 'confirm' - displays a javascript confirmation alert when the link is clicked
- 'popup' - if set to true, the link opens a new browser window
- 'post' - if set to true, the link submits a POST request instead of GET (caution: do not use inside a form)
Examples: echo link_to_unless($user->isAdministrator(), 'Delete this page', 'my_module/my_action');
=> Delete this page echo link_to_unless(!$user->isAdministrator(), 'Delete this page', 'my_module/my_action');
=> Delete this page
Creates a <a> link tag to the given email (with href="mailto:...").
If null is passed as a name, the email itself will become the name.
Options: - 'encode' - if set to true, the email address appears with various random encoding for each letter.
The mail link still works when encoded, but the address doesn't appear in clear
in the source. Use it to prevent spam (efficiency not guaranteed).
Examples: echo mail_to('webmaster@example.com');
=> webmaster@example.com echo mail_to('webmaster@example.com', 'send us an email');
=> send us an email echo mail_to('webmaster@example.com', 'send us an email', array('encode' => true));
=> send us an email