.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Catalyst::Dispatcher 3pm" .TH Catalyst::Dispatcher 3pm "2019-01-19" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Catalyst::Dispatcher \- The Catalyst Dispatcher .SH "SYNOPSIS" .IX Header "SYNOPSIS" See Catalyst. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is the class that maps public urls to actions in your Catalyst application based on the attributes you set. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" Construct a new dispatcher. .ie n .SS "$self\->preload_dispatch_types" .el .SS "\f(CW$self\fP\->preload_dispatch_types" .IX Subsection "$self->preload_dispatch_types" An arrayref of pre-loaded dispatchtype classes .PP Entries are considered to be available as \f(CW\*(C`Catalyst::DispatchType::CLASS\*(C'\fR To use a custom class outside the regular \f(CW\*(C`Catalyst\*(C'\fR namespace, prefix it with a \f(CW\*(C`+\*(C'\fR, like so: .PP .Vb 1 \& +My::Dispatch::Type .Ve .ie n .SS "$self\->postload_dispatch_types" .el .SS "\f(CW$self\fP\->postload_dispatch_types" .IX Subsection "$self->postload_dispatch_types" An arrayref of post-loaded dispatchtype classes .PP Entries are considered to be available as \f(CW\*(C`Catalyst::DispatchType::CLASS\*(C'\fR To use a custom class outside the regular \f(CW\*(C`Catalyst\*(C'\fR namespace, prefix it with a \f(CW\*(C`+\*(C'\fR, like so: .PP .Vb 1 \& +My::Dispatch::Type .Ve .ie n .SS "$self\->dispatch($c)" .el .SS "\f(CW$self\fP\->dispatch($c)" .IX Subsection "$self->dispatch($c)" Delegate the dispatch to the action that matched the url, or return a message about unknown resource .ie n .SS "$self\->visit( $c, $command [, \e@arguments ] )" .el .SS "\f(CW$self\fP\->visit( \f(CW$c\fP, \f(CW$command\fP [, \e@arguments ] )" .IX Subsection "$self->visit( $c, $command [, @arguments ] )" Documented in Catalyst .ie n .SS "$self\->go( $c, $command [, \e@arguments ] )" .el .SS "\f(CW$self\fP\->go( \f(CW$c\fP, \f(CW$command\fP [, \e@arguments ] )" .IX Subsection "$self->go( $c, $command [, @arguments ] )" Documented in Catalyst .ie n .SS "$self\->forward( $c, $command [, \e@arguments ] )" .el .SS "\f(CW$self\fP\->forward( \f(CW$c\fP, \f(CW$command\fP [, \e@arguments ] )" .IX Subsection "$self->forward( $c, $command [, @arguments ] )" Documented in Catalyst .ie n .SS "$self\->detach( $c, $command [, \e@arguments ] )" .el .SS "\f(CW$self\fP\->detach( \f(CW$c\fP, \f(CW$command\fP [, \e@arguments ] )" .IX Subsection "$self->detach( $c, $command [, @arguments ] )" Documented in Catalyst .ie n .SS "$self\->prepare_action($c)" .el .SS "\f(CW$self\fP\->prepare_action($c)" .IX Subsection "$self->prepare_action($c)" Find an dispatch type that matches \f(CW$c\fR\->req\->path, and set args from it. .ie n .SS "$self\->get_action( $action_name, $namespace )" .el .SS "\f(CW$self\fP\->get_action( \f(CW$action_name\fP, \f(CW$namespace\fP )" .IX Subsection "$self->get_action( $action_name, $namespace )" returns a named action from a given namespace. \f(CW$action_name\fR may be a relative path on that \f(CW$namespace\fR such as .PP .Vb 1 \& $self\->get_action(\*(Aq../bar\*(Aq, \*(Aqfoo/baz\*(Aq); .Ve .PP In which case we look for the action at 'foo/bar'. .ie n .SS "$self\->get_action_by_path( $path );" .el .SS "\f(CW$self\fP\->get_action_by_path( \f(CW$path\fP );" .IX Subsection "$self->get_action_by_path( $path );" Returns the named action by its full private path. .PP This method performs some normalization on \f(CW$path\fR so that if it includes '..' it will do the right thing (for example if \&\f(CW$path\fR is '/foo/../bar' that is normalized to '/bar'. .ie n .SS "$self\->get_actions( $c, $action, $namespace )" .el .SS "\f(CW$self\fP\->get_actions( \f(CW$c\fP, \f(CW$action\fP, \f(CW$namespace\fP )" .IX Subsection "$self->get_actions( $c, $action, $namespace )" .ie n .SS "$self\->get_containers( $namespace )" .el .SS "\f(CW$self\fP\->get_containers( \f(CW$namespace\fP )" .IX Subsection "$self->get_containers( $namespace )" Return all the action containers for a given namespace, inclusive .ie n .SS "$self\->uri_for_action($action, \e@captures)" .el .SS "\f(CW$self\fP\->uri_for_action($action, \e@captures)" .IX Subsection "$self->uri_for_action($action, @captures)" Takes a Catalyst::Action object and action parameters and returns a \s-1URI\s0 part such that if \f(CW$c\fR\->req\->path were this \s-1URI\s0 part, this action would be dispatched to with \f(CW$c\fR\->req\->captures set to the supplied arrayref. .PP If the action object is not available for external dispatch or the dispatcher cannot determine an appropriate \s-1URI,\s0 this method will return undef. .SS "expand_action" .IX Subsection "expand_action" expand an action into a full representation of the dispatch. mostly useful for chained, other actions will just return a single action. .ie n .SS "$self\->register( $c, $action )" .el .SS "\f(CW$self\fP\->register( \f(CW$c\fP, \f(CW$action\fP )" .IX Subsection "$self->register( $c, $action )" Make sure all required dispatch types for this action are loaded, then pass the action to our dispatch types so they can register it if required. Also, set up the tree with the action containers. .ie n .SS "$self\->setup_actions( $class, $context )" .el .SS "\f(CW$self\fP\->setup_actions( \f(CW$class\fP, \f(CW$context\fP )" .IX Subsection "$self->setup_actions( $class, $context )" Loads all of the pre-load dispatch types, registers their actions and then loads all of the post-load dispatch types, and iterates over the tree of actions, displaying the debug information if appropriate. .ie n .SS "$self\->dispatch_type( $type )" .el .SS "\f(CW$self\fP\->dispatch_type( \f(CW$type\fP )" .IX Subsection "$self->dispatch_type( $type )" Get the DispatchType object of the relevant type, i.e. passing \f(CW$type\fR of \&\f(CW\*(C`Chained\*(C'\fR would return a Catalyst::DispatchType::Chained object (assuming of course it's being used.) .SS "meta" .IX Subsection "meta" Provided by Moose .SH "AUTHORS" .IX Header "AUTHORS" Catalyst Contributors, see Catalyst.pm .SH "COPYRIGHT" .IX Header "COPYRIGHT" This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.