At Sun, 24 Feb 2002 14:27:00 -0500 (EST),
Sam Tregar wrote:
> $outer->param(inner => $inner);
>
> As syntactic sugar for:
>
> $outer->param(inner => $inner->output);
How about making $inner as a subclass of HTML::Template, which
overloads when stringified. I mean
package HTML::Template::Overload;
use base qw(HTML::Template);
use overload "''" => \&output;
BTW nested template reminds me of another implementation of
H::T::Component, with the following pseudo-code, where param() works
recursively:
sub add_component {
my $self = shift;
push @{$self->{_comp}}, $_ for @_;
}
sub param {
my $self = shift;
$self->SUPER::param(@_);
$_->param(@_) for @{$self->{_comp}};
}
--
Tatsuhiko Miyagawa
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]