Cataly...e::SSI(3pm)

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

πŸ’– Catalyst::View::Component::SubInclude::SSI πŸ’–

okay bestie, welcome to the User Contributed Perl Documentation section of the manual, page Catalyst::View::Component::SubInclude::SSI(3pm) β€” aka the little plugin that makes your includes go server-side and your caching go slay. πŸ¦‹


✨ NAME ✨

Catalyst::View::Component::SubInclude::SSI β€” Server Side Includes (SSI) plugin for C::V::Component::SubInclude πŸ’…


πŸŽ€ VERSION πŸŽ€

Version 0.10 β€” yes queen, we're on 0.10, no cap.


🌸 SYNOPSIS 🌸

first things first: in your view class, you do the little Moose ritual 🧚

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

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

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

then, somewhere in your templates β€” literally anywhere, she's flexible like that:

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

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


πŸ’œ DESCRIPTION πŸ’œ

Catalyst::View::Component::SubInclude::SSI renders subinclude calls as Server Side Includes (SSI) include directives. it's giving delegation, honestly.

this is a feature implemented by Apache (<http://httpd.apache.org/>), nginx (<http://wiki.nginx.org/Main>) and many other web servers which allows cache-efficient uses of includes. so like, the web server handles the include for you and your app gets to chill. main character energy fr fr. πŸ‘‘


πŸ”₯ METHODS πŸ”₯

generate_subinclude( $c, $path, @args )

okay so important note bestie: $path should be the private action path β€” the translation to the public path is handled internally, you don't gotta worry about it. 🫢

after translation, this will roughly translate to the following code:

my $url = $c->uri_for( $translated_path, @args )->path_query;
return '<!--#include virtual="$url" -->';
⚠️ Notice that the stash will always be empty. always always. this behavior could be configurable in the future through an additional switch β€” for now, this behavior guarantees a common interface for plugins. so it's not a bug, it's a contract. πŸ’€βœ¨

🌈 SEE ALSO 🌈

  • Catalyst::View::Component::SubInclude

πŸ‘‘ AUTHOR πŸ‘‘

Vladimir Timofeev, "<vovkasm at gmail.com>" πŸ’Œ


This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. iconic, generous, legally iconic. πŸ’–


and that's the whole page, bestie!! πŸ’… this was Cataly...e::SSI(3pm) from the User Contributed Perl Documentation, sitting pretty at perl v5.34.0, dated 2022-06-09 β€” go forth and subinclude responsibly. mwah. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from