Cataly...atcher(3pm)

πŸ“¦
version 5.90132 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Catalyst::Dispatcher β€” literally the Catalyst Dispatcher, bestie. no cap.


✨ SYNOPSIS ✨

okay so, See Catalyst. that's it. that's the synopsis. go look at Catalyst, she's the main character here 🫢


🌸 DESCRIPTION 🌸

so basically? this is the class that maps your public urls to actions in your Catalyst application, based on the attributes you set. she's the vibe check between "what the user typed in the url bar" and "which action is gonna handle it." iconic behaviour, fr fr πŸ‘‘


πŸŽ€ METHODS πŸŽ€

πŸ’… new

Construct a new dispatcher. fresh out the box, slay.

πŸ’œ $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, if nobody matched, return a message about unknown resource. like a bouncer who's either letting you in or telling you there's no such party 😭

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

Documented in Catalyst. (iykyk πŸ’«)

⭐ $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. that's the whole job. periodt.

🧚 $self->get_action( $action_name, $namespace )

returns a named action from a given namespace. $action_name may be a relative path on that $namespace such as

$self->get_action('../bar', 'foo/baz');

In which case we look for the action at 'foo/bar'. yes bestie she does the relative path math for you πŸ’…

🌸 $self->get_action_by_path( $path );

Returns the named action by its full private path.

This method performs some normalization on $path so that if it includes '..' it will do the right thing (for example if $path is '/foo/../bar' that is normalized to '/bar'. β€” she cleaned it UP ✨

πŸ’– $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. sad girl hours 😭

πŸ”₯ 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. she's doing SO much, give her a moment 🫢

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

πŸ’œ $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. (iconic crossover event πŸ’…)


πŸ’– AUTHORS πŸ’–

Catalyst Contributors, see Catalyst.pm


This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. free as in bestie, go off πŸ’œ


and that's the whole page, no cap 🫢 written against perl v5.40.0, dated 2024-11-15, straight outta the User Contributed Perl Documentation for Cataly...atcher(3pm) β€” mwah πŸ’‹βœ¨
πŸ“¦ where this page comes from