Skip to content

Commit

Permalink
A bit about the flexibility and extensibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sartak committed Oct 24, 2010
1 parent 9aee214 commit 2e64fd3
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion lib/Path/Dispatcher.pm
Expand Up @@ -116,7 +116,34 @@ rules, and it returns a list of matches. From there you can "run" the rules
that matched. These phases are distinct so that, if you need to, you can
inspect which rules were matched without ever running their codeblocks.
You want to use L<Path::Dispatcher::Declarative> which gives you some sugar
Each rule may take a variety of different forms. Some of the rule types are:
=over 4
=item L<Path::Dispatcher::Rule::Regex>
Matches the path against a regular expression.
=item L<Path::Dispatcher::Rule::Enum>
Match one of a set of strings.
=item L<Path::Dispatcher::Rule::CodeRef>
Execute a coderef to determine whether the path matches the rule.
=item L<Path::Dispatcher::Rule::Dispatch>
Use another L<Path::Dispatcher> to match the path.
=back
Since L<Path::Dispatcher> is designed with good object-oriented programming
practices, you can also write your own domain-specific rule classes. For
example, in L<Prophet>, we have a custom rule for matching, and tab completing,
record IDs.
You may want to use L<Path::Dispatcher::Declarative> which gives you some sugar
inspired by L<Jifty::Dispatcher>.
=head1 ATTRIBUTES
Expand Down

0 comments on commit 2e64fd3

Please sign in to comment.