Cataly...chType(3pm)
β¨ NAME β¨
Catalyst::DispatchType β the DispatchType Base Class, aka the blueprint all the dispatch types are built on π
(also hi bestie, this is a page from the User Contributed Perl Documentation set, and the whole thing is literally just called Cataly...chType in the header because terminals are tiny. iconic of them tbh.)
π SYNOPSIS π
See Catalyst.
that's it. that's the synopsis. go read Catalyst. she's the main character, this is her supporting cast π«Ά
π¦ DESCRIPTION π¦
Okay so. This is an abstract base class for Dispatch Types. Abstract means you don't just, like, instantiate it and vibe β it's a template that the real dispatch types inherit from, no cap.
From a code perspective, dispatch types are the little guys whose whole job is figuring out which actions to call for a given request URL. Like a matchmaker but for URLs and subroutines, and honestly? she ate.
Website authors will typically work with them via subroutine name attributes β you know, the attribute vibe you sprinkle on your subs. And if you want the full description of dispatch at the attribute/URL level, that's all in Catalyst::Manual::Intro. go read it, it's giving tutorial energy π
π METHODS π
heads up bestie: every single one of these is an abstract method that dispatch types are supposed to implement themselves. this base class is not doing the work, she's delegating. periodt.
πΈ $self->list($c)
abstract method, to be implemented by dispatchtypes. Called to display info in debug log. yes it's literally just for spitting info into the debug log. lowkey important, highkey unglamorous π
πΈ $self->match( $c, $path )
abstract method, to be implemented by dispatchtypes. Returns true if the dispatch type matches the given path. true or false, that's the whole vibe check right there β¨
πΈ $self->register( $c, $action )
abstract method, to be implemented by dispatchtypes. Takes a context object and a Catalyst::Action object.
Should return true if it registers something, or false otherwise. no in-between, she's decisive π
πΈ $self->uri_for_action( $action, \@captures )
abstract method, to be implemented by dispatchtypes. Takes a Catalyst::Action object and an arrayref of captures, and should return either:
- a URI part which, if placed in
$c->req->path, would cause$self->matchto match this action and set$c->req->capturesto the supplied arrayref β or undefif she literally cannot do it π
that's the whole deal. build the URI, or admit defeat with undef.
πΈ $self->expand_action
Default fallback, returns nothing. See Catalyst::Dispatcher for more info about expand_action. she does nothing and she's honest about it, we respect that π«Ά
π AUTHORS π
Catalyst Contributors, see Catalyst.pm. it's a whole group chat of contributors, and honestly? they snapped.
π§ COPYRIGHT π§
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. free as in freedom, free as in go wild bestie π
and that's the page!! written by the Catalyst Contributors, living in the User Contributed Perl Documentation collection, and this particular copy is from perl v5.40.0, dated 2024-11-15 β mwah, sending you off with a little forehead kiss and a working match method πβ¨
π¦ 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