Commit 9019c6e2 authored by Taylor Otwell's avatar Taylor Otwell

added link_to_action method to html class.

parent d6fba0ad
...@@ -180,6 +180,30 @@ class HTML { ...@@ -180,6 +180,30 @@ class HTML {
return static::link(URL::to_route($name, $parameters), $title, $attributes); return static::link(URL::to_route($name, $parameters), $title, $attributes);
} }
/**
* Generate an HTML link to a controller action.
*
* An array of parameters may be specified to fill in URI segment wildcards.
*
* <code>
* // Generate a link to the "home@index" action
* echo HTML::link_to_action('home@index', 'Home');
*
* // Generate a link to the "user@profile" route and add some parameters
* echo HTML::link_to_action('user@profile', 'Profile', array('taylor'));
* </code>
*
* @param string $action
* @param string $title
* @param array $parameters
* @param array $attributes
* @return string
*/
public static function link_to_action($action, $title, $parameters = array(), $attributes = array())
{
return static::link(URL::to_action($action, $parameters), $title, $attributes);
}
/** /**
* Generate an HTML mailto link. * Generate an HTML mailto link.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment