1Catalyst::Dispatcher(3)User Contributed Perl DocumentatioCnatalyst::Dispatcher(3)
2
3
4

NAME

6       Catalyst::Dispatcher - The Catalyst Dispatcher
7

SYNOPSIS

9       See Catalyst.
10

DESCRIPTION

12       This is the class that maps public urls to actions in your Catalyst
13       application based on the attributes you set.
14

METHODS

16   new
17       Construct a new dispatcher.
18
19   $self->preload_dispatch_types
20       An arrayref of pre-loaded dispatchtype classes
21
22       Entries are considered to be available as
23       "Catalyst::DispatchType::CLASS" To use a custom class outside the
24       regular "Catalyst" namespace, prefix it with a "+", like so:
25
26           +My::Dispatch::Type
27
28   $self->postload_dispatch_types
29       An arrayref of post-loaded dispatchtype classes
30
31       Entries are considered to be available as
32       "Catalyst::DispatchType::CLASS" To use a custom class outside the
33       regular "Catalyst" namespace, prefix it with a "+", like so:
34
35           +My::Dispatch::Type
36
37   $self->dispatch($c)
38       Delegate the dispatch to the action that matched the url, or return a
39       message about unknown resource
40
41   $self->visit( $c, $command [, \@arguments ] )
42       Documented in Catalyst
43
44   $self->go( $c, $command [, \@arguments ] )
45       Documented in Catalyst
46
47   $self->forward( $c, $command [, \@arguments ] )
48       Documented in Catalyst
49
50   $self->detach( $c, $command [, \@arguments ] )
51       Documented in Catalyst
52
53   $self->prepare_action($c)
54       Find an dispatch type that matches $c->req->path, and set args from it.
55
56   $self->get_action( $action_name, $namespace )
57       returns a named action from a given namespace.  $action_name may be a
58       relative path on that $namespace such as
59
60           $self->get_action('../bar', 'foo/baz');
61
62       In which case we look for the action at 'foo/bar'.
63
64   $self->get_action_by_path( $path );
65       Returns the named action by its full private path.
66
67       This method performs some normalization on $path so that if it includes
68       '..' it will do the right thing (for example if $path is '/foo/../bar'
69       that is normalized to '/bar'.
70
71   $self->get_actions( $c, $action, $namespace )
72   $self->get_containers( $namespace )
73       Return all the action containers for a given namespace, inclusive
74
75   $self->uri_for_action($action, \@captures)
76       Takes a Catalyst::Action object and action parameters and returns a URI
77       part such that if $c->req->path were this URI part, this action would
78       be dispatched to with $c->req->captures set to the supplied arrayref.
79
80       If the action object is not available for external dispatch or the
81       dispatcher cannot determine an appropriate URI, this method will return
82       undef.
83
84   expand_action
85       expand an action into a full representation of the dispatch.  mostly
86       useful for chained, other actions will just return a single action.
87
88   $self->register( $c, $action )
89       Make sure all required dispatch types for this action are loaded, then
90       pass the action to our dispatch types so they can register it if
91       required.  Also, set up the tree with the action containers.
92
93   $self->setup_actions( $class, $context )
94       Loads all of the pre-load dispatch types, registers their actions and
95       then loads all of the post-load dispatch types, and iterates over the
96       tree of actions, displaying the debug information if appropriate.
97
98   $self->dispatch_type( $type )
99       Get the DispatchType object of the relevant type, i.e. passing $type of
100       "Chained" would return a Catalyst::DispatchType::Chained object
101       (assuming of course it's being used.)
102
103   meta
104       Provided by Moose
105

AUTHORS

107       Catalyst Contributors, see Catalyst.pm
108
110       This library is free software. You can redistribute it and/or modify it
111       under the same terms as Perl itself.
112
113
114
115perl v5.36.0                      2023-01-20           Catalyst::Dispatcher(3)
Impressum