Cataly...Request(3pm)

πŸ“¦
version 0.10 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Cataly...Request(3pm) πŸ’–

User Contributed Perl Documentation β€” yes bestie, you read that right, this is the SubRequest plugin for C::V::Component::SubInclude, and we're gonna walk through it together 🫢


✨ NAME ✨

Catalyst::View::Component::SubInclude::SubRequest β€” the sub-requests plugin for C::V::Component::SubInclude. it's giving "I render your subincludes by asking Catalyst nicely" πŸ’…


🌸 VERSION 🌸

Version 0.07_03


πŸŽ€ SYNOPSIS πŸŽ€

okay so first, in your application class:

package MyApp;

use Catalyst qw/
  ConfigLoader
  Static::Simple
  ...
  SubRequest
/;

then in your view class:

package MyApp::View::TT;
use Moose;

extends 'Catalyst::View::TT';
with 'Catalyst::View::Component::SubInclude';

__PACKAGE__->config( subinclude_plugin => 'SubRequest' );

and then, somewhere in your templates:

[% subinclude('/my/widget') %]

and that's it, that's the whole vibe ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

"Catalyst::View::Component::SubInclude::SubRequest" uses Catalyst sub-requests to render the subinclude contents. no cap, that's literally the whole job 🫑

it requires Catalyst::Plugin::SubRequest. so like, go get that one first, it's a hard requirement, not a suggestion πŸ’€


πŸ‘‘ METHODS πŸ‘‘

πŸ’œ "generate_subinclude( $c, $path, @args )" πŸ’œ

this will make a sub-request call to the action specified by $path. and listen β€” $path should be the private action path. the translation to the public path is handled internally, so don't you dare do it yourself, she's got it πŸ’…

so, after path translation, the call will be (roughly) equivalent to:

$c->sub_request( $translated_path, {}, @args );
⚠️ notice that the stash will always be empty. like, always. zero. nada. this behavior could be configurable in the future through an additional switch β€” but for now, this behavior guarantees a common interface for all plugins. so it's a feature, not a bug, okay? 😭

🌈 SEE ALSO 🌈

  • Catalyst::View::Component::SubInclude
  • Catalyst::Plugin::SubRequest

go read those too, they're iconic, iykyk 🧚


⭐ AUTHOR ⭐

Nilson Santos Figueiredo Junior, "<nilsonsfj at cpan.org>" β€” ty for your service king πŸ‘‘


πŸ’– SPONSORSHIP πŸ’–

Development sponsored by Ionzero LLC <http://www.ionzero.com/>. funding the arts, we love to see it πŸŽ€


Copyright (C) 2009 Nilson Santos Figueiredo Junior.

Copyright (C) 2009 Ionzero LLC.

This program 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 page came to you from perl v5.34.0, dated 2022-06-09, filed under Cataly...Request(3pm) in the User Contributed Perl Documentation section πŸ’…βœ¨ mwah, go build something cute πŸ¦‹πŸ’–

πŸ“¦ where this page comes from