1 package Catalyst::DispatchType;
4 with 'MooseX::Emulate::Class::Accessor::Fast';
9 Catalyst::DispatchType - DispatchType Base Class
17 This is an abstract base class for Dispatch Types.
19 From a code perspective, dispatch types are used to find which actions
20 to call for a given request URL. Website authors will typically work
21 with them via subroutine names attributes; a description of dispatch
22 at the attribute/URL level is given in L<Catalyst::Manual::Intro>.
26 =head2 $self->list($c)
28 abstract method, to be implemented by dispatchtypes. Called to display
35 =head2 $self->match( $c, $path )
37 abstract method, to be implemented by dispatchtypes. Returns true if the
38 dispatch type matches the given path
42 sub match { die "Abstract method!" }
44 =head2 $self->register( $c, $action )
46 abstract method, to be implemented by dispatchtypes. Takes a
47 context object and a L<Catalyst::Action> object.
49 Should return true if it registers something, or false otherwise.
55 =head2 $self->uri_for_action( $action, \@captures )
57 abstract method, to be implemented by dispatchtypes. Takes a
58 L<Catalyst::Action> object and an arrayref of captures, and should
59 return either a URI part which if placed in $c->req->path would cause
60 $self->match to match this action and set $c->req->captures to the supplied
61 arrayref, or undef if unable to do so.
65 sub uri_for_action { }
67 =head2 $self->expand_action
69 Default fallback, returns nothing. See L<Catalyst::Dispatcher> for more info
78 Catalyst Contributors, see Catalyst.pm
82 This library is free software. You can redistribute it and/or modify it under
83 the same terms as Perl itself.
87 __PACKAGE__->meta->make_immutable;