Marcus Ramberg > Catalyst-Runtime-5.80012 > Catalyst::Dispatcher

Download:
Catalyst-Runtime-5.80012.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

New  18
Open  15
Stalled  1
View/Report Bugs
Source   Latest Release: Catalyst-Runtime-5.90069_002

NAME ^

Catalyst::Dispatcher - The Catalyst Dispatcher

SYNOPSIS ^

See Catalyst.

DESCRIPTION ^

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

METHODS ^

new

Construct a new dispatcher.

$self->preload_dispatch_types

An arrayref of pre-loaded dispatchtype classes

Entries are considered to be available as Catalyst::DispatchType::CLASS To use a custom class outside the regular Catalyst namespace, prefix it with a +, like so:

    +My::Dispatch::Type

$self->postload_dispatch_types

An arrayref of post-loaded dispatchtype classes

Entries are considered to be available as Catalyst::DispatchType::CLASS To use a custom class outside the regular Catalyst namespace, prefix it with a +, like so:

    +My::Dispatch::Type

$self->dispatch($c)

Delegate the dispatch to the action that matched the url, or return a message about unknown resource

$self->visit( $c, $command [, \@arguments ] )

Documented in Catalyst

$self->go( $c, $command [, \@arguments ] )

Documented in Catalyst

$self->forward( $c, $command [, \@arguments ] )

Documented in Catalyst

$self->detach( $c, $command [, \@arguments ] )

Documented in Catalyst

$self->prepare_action($c)

Find an dispatch type that matches $c->req->path, and set args from it.

$self->get_action( $action, $namespace )

returns a named action from a given namespace.

$self->get_action_by_path( $path );

Returns the named action by its full private path.

$self->get_actions( $c, $action, $namespace )

$self->get_containers( $namespace )

Return all the action containers for a given namespace, inclusive

$self->uri_for_action($action, \@captures)

Takes a Catalyst::Action object and action parameters and returns a URI part such that if $c->req->path were this URI part, this action would be dispatched to with $c->req->captures set to the supplied arrayref.

If the action object is not available for external dispatch or the dispatcher cannot determine an appropriate URI, this method will return undef.

expand_action

expand an action into a full representation of the dispatch. mostly useful for chained, other actions will just return a single action.

$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.

$self->setup_actions( $class, $context )

Loads all of the preload dispatch types, registers their actions and then loads all of the postload dispatch types, and iterates over the tree of actions, displaying the debug information if appropriate.

$self->dispatch_type( $type )

Get the DispatchType object of the relevant type, i.e. passing $type of Chained would return a Catalyst::DispatchType::Chained object (assuming of course it's being used.)

meta

Provided by Moose

AUTHORS ^

Catalyst Contributors, see Catalyst.pm

COPYRIGHT ^

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: