[Catalyst] :Template() Attribute

Matt S Trout dbix-class at trout.me.uk
Sun Jun 17 16:35:42 GMT 2007


On Sat, Jun 16, 2007 at 08:37:46PM -0500, Jonathan Rockway wrote:
> On Friday 15 June 2007 08:36:33 am Christopher H. Laco wrote:
> 
> > OPTION #2: View::TT, View::Mason, View::**
> > ----------------------------------------------
> >
> > PROS:
> >
> > Template() will be honored with the use of RenderView and the use of
> > forwarding to a view manually (like in REST or other controller code).
> >
> > CONS:
> >
> > This has to be implemented in each View::** package that wants to
> > support it.
> >
> > IF one changes from a view the support it, to one that doesn't,
> > controllers go boom.
> >
> 
> What we really need to do is add a utility method like template_name() to the 
> Catalyst::View base class.  Even without the :Template attribute, there is 
> code duplicated between every view that shouldn't be( $template = 
> $c->action || $c->stash->{template} ). 

I was pondering a base class but it shouldn't be ::View itself, since ::View
is a base for things like JSON views where the concept of a template doesn't
(currently, anyway) make any sense.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Catalyst mailing list