Catalyst::Action(3pm)
π NAME π
Catalyst::Action β it's the Catalyst Action, bestie. That's the whole vibe.
β¨ SYNOPSIS β¨
<form action="[%c.uri_for(c.action)%]">
$c->forward( $action->private_path );
πΈ DESCRIPTION πΈ
Okay so Catalyst::Action is the class that represents a Catalyst Action. It's giving main character energy for every single route your app dispatches, fr fr.
You can grab the object for the action that's currently being dispatched through $c->action. If you wanna know more about how actions actually get dispatched, go peek at Catalyst::Dispatcher β that's the whole lore drop. π¦
And where do actions come from? They're defined inside Catalyst::Controller subclasses. That's the birth certificate. π
π METHODS π
attributes
The sub attributes that are set for this action β like Local, Path, Private and so on. This is literally what determines how the action gets dispatched to. It's the action's whole personality, no cap. β¨
class
Returns the name of the component where this action is defined. It's derived by calling the catalyst_component_name method on each component. π·οΈ
code
Returns a code reference to this action. It's the actual code-y bit. π₯
dispatch( $c )
Dispatch this action against a context. Go little action, go. π
execute( $controller, $c, @args )
Execute this action's coderef against a given controller with a given context and arguments. Yes queen, run the thing with all the things. π
match( $c )
Check the Args attribute, and makes sure the number of args matches the setting. And here's the good part: it always returns true if Args is omitted. So if you didn't set it, you're automatically slaying. π
match_captures ($c, $captures)
This one can be implemented by action class and action role authors β iykyk. If the method exists, then it will be called with the request context and an array reference of the captures for this action.
Returning true from this method causes the chain match to continue, returning makes the chain not match (and alternate, less preferred chains will be attempted). π
match_captures_constraints ($c, \@captures);
Does the \@captures given match any constraints (if any constraints exist)? Returns true if you ask but there are no constraints. Very "yes, obviously, bestie" of it. π
match_args($c, $args)
Does the Args match or not? That's it. That's the question. π€
resolve_type_constraint
Tries to find a type constraint if you have on on a type constrained method. π
compare
Compares 2 actions based on the value of the "Args" attribute, with no "Args" having the highest precedence. So having nothing at all is the top of the food chain. Iconic behaviour honestly. π
equals
if( $action->equal($other_action) ) { ... }
Returns true if the two actions are equal. Twin flames check. π«Ά
namespace
Returns the private namespace this action lives in. That's its home address. π‘
reverse
Returns the private path for this action.
private_path
Returns absolute private path for this action. And unlike "reverse", the "private_path" of an action is always suitable for passing to "forward". That's the key difference, don't forget it bestie. β
name
Returns the sub name of this action. π
number_of_args
Returns the number of args this action expects. This is 0 if the action doesn't take any arguments and undef if it will take any number of arguments. Zero means zero, undef means "however many, we're flexible." π«
normalized_arg_number
The number of arguments (starting with zero) that the current action defines, or undefined if there is not defined number of args β which is later treated as, " as many arguments as you like". β¨
comparable_arg_number
For the purposes of comparison we normalize 'number_of_args' so that if it is undef we mean ~0 (as many args are we can think of). Math but make it cute. π’
number_of_captures
Returns the number of captures this action expects for Chained actions. βοΈ
list_extra_info
A HashRef of key-values that an action can provide to a debugging screen. Extra info for the girlies who debug. π
scheme
Any defined scheme for the action. π
meta
Provided by Moose. That's all it says, and honestly? Respect. π«‘
π 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. π«Ά
And that's a wrap, bestie! This little masterpiece came to you courtesy of perl v5.40.0, dated 2024-11-15, and yeah β Catalyst::Action(3pm) is the moment. Periodt. π β¨
π¦ where this page comes from
- debian trixie: libcatalyst-perl 5.90132-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatalyst-perl 5.90132-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatalyst-perl 5.90132-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms