Re: petal include: modifier
Josh Narins <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.petal |
|---|---|
| Message-ID | <[email protected]> |
> This is very simple, and allows you to do something like this
>
> given {
> template => 'content.html'
> }
> you can do
>
> <html>
> <div petal:content="structure include: ${template}" />
> </html>
>
> and content.html will be included in your main site.
>
> And as everybody knows, there is always more than one way to do it, but
> this worked for me.
>
>
> package Petal::Hash::Include;
>
> use strict;
> use warnings;
>
> use base qw/Petal::Hash::String/;
>
> sub process {
> my ($self, $hash, $args) = @_;
>
> my $fn = $self->SUPER::process($hash, $args);
> my $tpl = Petal->new($fn);
> return $tpl->process($hash);
> }
>
> 1;
I remember this solution before.
Doesn't it result in a double petal process'ing of the whole document?
If not, I'm sorry for not understanding before.
--
xplanet -body earth -transpng a.png -geometry "300x300-0+0" -origin sun
My politics : http://satp.blogspot.com
Perl Programmer
signature.asc
(application/pgp-signature, 232 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQFB5wz5qmX4LWzvJuARAnGeAJ9FFL9JkB4yjux0C/gXoegIiOQmYQCfccqE ++FQb2QhQmg+eF2pOYX6bdY= =WlO3 -----END PGP SIGNATURE-----