The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mojolicious::Routes::Match - Routes Visitor

SYNOPSIS

use Mojolicious::Routes::Match;

DESCRIPTION

Mojolicious::Routes::Match is a visitor for Mojolicious::Routes structures.

ATTRIBUTES

Mojolicious::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(Mojolicious::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.

METHODS

Mojolicious::Routes::Match inherits all methods from Mojo::Base and implements the following ones.

new

my $m = Mojolicious::Routes::Match->new(Mojolicious:Controller->new);

Construct a new match object.

match

$m->match(Mojolicious::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.

SEE ALSO

Mojolicious, Mojolicious::Guides, http://mojolicious.org.