Catalyst::View(3pm)

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

πŸ’– Catalyst::View β€” the manual, but make it cute πŸ’–

okay so bestie, you found the Catalyst::View page, aka the base class for views in Catalyst. It lives in the User Contributed Perl Documentation corner of your system, and yes, we're reading it together. 🫢


✨ NAME ✨

Catalyst::View β€” it's the Catalyst View base class. That's the whole name. Iconic, brief, slays. πŸ‘‘


🌸 SYNOPSIS 🌸

Here's the vibe, verbatim, no edits, no notes:

package Catalyst::View::Homebrew;

use base qw/Catalyst::View/;

sub process {
# template processing goes here.
}

Literally that's it. You subclass it, you write your own process, and the template magic goes in there. πŸͺ„


πŸ¦‹ DESCRIPTION πŸ¦‹

So. This is the Catalyst View base class, and its whole purpose in life is to be used as a base class by Catalyst views. Like, it's the blueprint bestie, not the building. πŸ—οΈ

By convention (and convention is doing a LOT of heavy lifting here), views are expected to:

  • read template names from $c->stash->{template} πŸ“–
  • put the output into $c->res->body πŸ“€

Some views will lowkey just default to rendering a template named after the dispatched action's private name. (If you wanna know what that means, go look at Catalyst::Action β€” it's linked in spirit, iykyk. ✨)


πŸ’… METHODS πŸ’…

Not me implementing the exact same methods as every other Catalyst component β€” because yes, that's the whole point. Go check Catalyst::Component for the full tea. 🍡

πŸŽ€ process πŸŽ€

gives an error message about direct use.

That's it. That's the method. It does NOT want to be called directly, bestie β€” it will literally just yell at you about it. Direct use = error message, periodt. 😭 So please, subclass it and override it like a normal person. πŸ™ˆ


πŸ‘‘ AUTHORS πŸ‘‘

Catalyst Contributors, see Catalyst.pm β€” the whole squad, credited as one. We love a collective moment. 🫢


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


friendly reminder from your girl: the vibe is cute but the facts are sacred β€” every flag, path, and warning up there is exactly as the original says it. don't come for me, come for the docs. πŸ’€

mwah πŸ’– This page was brought to you by perl v5.40.0, dated 2024-11-15, straight from the User Contributed Perl Documentation. Go forth and render some templates, main character. πŸŒΈπŸ¦‹πŸŽ€β­

πŸ“¦ where this page comes from