MojoX::Routes::Match - Routes Visitor
use MojoX::Routes::Match; # New match object my $m = MojoX::Routes::Match->new($c); # Match $m->match($routes);
MojoX::Routes::Match is a visitor for MojoX::Routes structures.
MojoX::Routes::Match implements the following attributes.
captures
my $captures = $m->captures; $m = $m->captures({foo => 'bar'});
Captured parameters.
endpoint
my $endpoint = $m->endpoint; $m = $m->endpoint(MojoX::Routes->new);
The routes endpoint that actually matched.
root
my $root = $m->root; $m = $m->root($routes);
The root of the routes tree.
stack
my $stack = $m->stack; $m = $m->stack([{foo => 'bar'}]);
Captured parameters with nesting history.
MojoX::Routes::Match inherits all methods from Mojo::Base and implements the following ones.
new
my $m = MojoX::Routes::Match->new(MojoX:Controller->new);
Construct a new match object.
match
$m->match(MojoX::Routes->new);
Match against a routes tree.
url_for
my $url = $m->url_for; my $url = $m->url_for(foo => 'bar'); my $url = $m->url_for({foo => 'bar'}); my $url = $m->url_for('named'); my $url = $m->url_for('named', foo => 'bar'); my $url = $m->url_for('named', {foo => 'bar'});
Render matching route with parameters into a Mojo::URL object.
Mojolicious, Mojolicious::Guides, http://mojolicious.org.
To install Mojolicious, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious
CPAN shell
perl -MCPAN -e shell install Mojolicious
For more information on module installation, please visit the detailed CPAN module installation guide.