Michael Graham wrote:
But AnyTemplate has the feature of named independent configs:
$self->template('your_module')->config(...)
$self->template('my_plugin')->config(...)
These configs remain separate from each other. However, you have to
keep using these names throughout your module, even when you load and
fill the template. For instance:
sub my_runmode {
my $self = shift;
my $template = $self->template('my_plugin')->load;
$template->output;
}
sub your_runmode {
my $self = shift;
my %params;
$self->template('your_module')->fill(\%params);
}
It's uglier and more verbose, but it also prevents plugins from
stepping on each other's toes.
I had seen that in the documentation but I couldn't really think of a good use case for why I would need it. Thanks for bringing that up.
I'm thinking that most C::A plugins that use AnyTemplate should probably default to using their own package name for the AnyTemplate config name, and maybe they could also allow the user to specify an explicit config name, so the user can use their own AnyTemplate settings if they want.
Thanks for letting us know. I'm reworking CGI::Application::Search to use AnyTemplate at the moment (even though I lied in my YAPC talk and said it 'currently' supports it... well it 'currently' supported it on my laptop :)
--
Michael Peters
Developer
Plus Three, LP
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.