Routes::Tiny::Pattern - Routes pattern
my $pattern = Routes::Tiny::Pattern->new( pattern => '/:foo/:bar', defaults => {bar => 'index'}, name => 'route' ); my $match = $pattern->match('/hello/world'); my $path = $pattern->build_path('route', foo => 'hello', bar => 'world');
Routes::Tiny::Pattern is an Object that incapsulates pattern matching and path building.
defaults
Pass default values for captures.
constraints
Pass constraints.
name
Pass route name.
arguments
Pass arbitrary arguments.
new
my $pattern = Routes::Tiny::Pattern->new;
Create new instance of Routes::Tiny::Pattern.
match
Match pattern agains a path.
build_path
$pattern->build_path('name', {foo => 'bar'});
Build path from a given name and params.
To install Routes::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Routes::Tiny
CPAN shell
perl -MCPAN -e shell install Routes::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.