> http://charlotte.pm.org/kwiki/index.cgi?BreadProject
This is very cool! I hope to help out with this. I think it will be
good for PR as well.
Reading the docs started me thinking about integration with AnyTemplate.
Here are some notes on what to keep in mind when we implement the
templating side of the BREAD plugin, but the issues apply to other
plugins besides BREAD.
When a plugin that uses AnyTemplate calls:
$self->template->config(...)
It overwrites any existing template configuration with the new settings.
So if two plugins do that, they probably clobber each other.
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'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.
Michael
-----------------------------------------------------------------------
Michael Graham <suppressed>
YAPC::NA 2005 Toronto - http://www.yapc.org/America/ - suppressed
-----------------------------------------------------------------------
---------------------------------------------------------------------
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.