Mojolicious::Routes::Match man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Mojolicious::Routes::MUser(Contributed Perl DocumMojolicious::Routes::Match(3)

NAME
       Mojolicious::Routes::Match - Routes Visitor

SYNOPSIS
	 use Mojolicious::Routes;
	 use Mojolicious::Routes::Match;

	 # Routes
	 my $r = Mojolicious::Routes->new;
	 $r->route('/foo')->to(action => 'foo');
	 $r->route('/bar')->to(action => 'bar');

	 # Match
	 my $m = Mojolicious::Routes::Match->new(GET => '/bar');
	 $m->match($r);
	 print $m->captures->{action};

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(get => '/foo');
	 my $m = Mojolicious::Routes::Match->new(get => '/foo', $ws);

       Construct a new match object.

   "match"
	 $m->match(Mojolicious::Routes->new, Mojolicious::Controller->new);

       Match against a routes tree.

   "path_for"
	 my $path	 = $m->path_for;
	 my $path	 = $m->path_for(foo => 'bar');
	 my $path	 = $m->path_for({foo => 'bar'});
	 my $path	 = $m->path_for('named');
	 my $path	 = $m->path_for('named', foo => 'bar');
	 my $path	 = $m->path_for('named', {foo => 'bar'});
	 my ($path, $ws) = $m->path_for;
	 my ($path, $ws) = $m->path_for(foo => 'bar');
	 my ($path, $ws) = $m->path_for({foo => 'bar'});
	 my ($path, $ws) = $m->path_for('named');
	 my ($path, $ws) = $m->path_for('named', foo => 'bar');
	 my ($path, $ws) = $m->path_for('named', {foo => 'bar'});

       Render matching route with parameters into path.

SEE ALSO
       Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.

perl v5.14.1			  2011-09-11	 Mojolicious::Routes::Match(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net