[jifty-devel] RFC: Improved Template::Declare Wrappers

Jesse Vincent jesse at bestpractical.com
Thu Nov 12 13:11:18 EST 2009

> I've been thinking about Template::Declare wrappers since I [blogged](http://www.justatheory.com/computers/programming/perl/catalyst/template-declare-wrapper.html 
> ) about them last week. They just feel way too bolted on. This is my  
> fault, as I created them without really understanding how  
> Template::Declare worked. But now that I do understand, I'd like to  
> propose a new API for wrappers. My inspiration is Mason autohandlers,  

Hrm. I think I'd be a lot happier separating the "autohandler" concept from
a more generic "wrapper" concept.

In my ideal world, I'd be able to use different wrappers for different
templates at the same "level" - in apps with dispatchers, sometimes the
package and desired wrappers don't match up exactly 1 to 1.

I'd love to be able to say:

wrap template 'foo' with 'my_gorgeous_page_layout' => sub {


I can totally see a good argument for a package level default wrapper.
Maybe somethign like:

default wrapper 'my_ugly_wrapper';

( multiple default wrappers would be an error. )


More information about the jifty-devel mailing list