Catalyst::View::Template::Lace::Role::URI - Shortcut to create a URI on the current controller
package MyApp::View::User; use Moo; extends 'Catalyst::View::Template::Lace'; with 'Catalyst::View::Template::Lace::Role::URI'; sub template {q[ <html> <head> <title>Link Example</title> </head> <body> <a>Link</a> </body> </html> ]} sub process_dom { my ($self, $dom) = @_; $dom->at('a') ->href($self->uri('../display)); }
A role that gives your model object a uri method. This method works similarly to "$c->uri_for" except that it only takes an action object or a string that is an absolute or relative (to the current controller) private name.
uri
This role defines the following methods
$self->uri($action); $self->uri('/user/display'); $self->uri('display'); $self->uri('../list');
First argument is an action object or a string. If a string it must be either an absolute private name to an action or a relative one
Catalyst::View::Template::Lace.
Please See Catalyst::View::Template::Lace for authorship and contributor information.
Please see Catalyst::View::Template::Lace for copyright and license information.
To install Catalyst::View::Template::Lace, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::View::Template::Lace
CPAN shell
perl -MCPAN -e shell install Catalyst::View::Template::Lace
For more information on module installation, please visit the detailed CPAN module installation guide.