[Catalyst] :Template() Attribute

Bill Moseley moseley at hank.org
Fri Jun 15 16:10:44 GMT 2007


On Fri, Jun 15, 2007 at 10:33:29AM -0400, Christopher H. Laco wrote:
> Imho, :Template('foo') is a lot more elegant than $c->stash->{'template'}
> 
> Anytime I have to futz with hash contents that control functionality in
> other things that I didn't write (like Views), it feels dirty...akin to
> altering $self->{'option'} = 'foo' instead of doing $self->option('foo')
> 
> Just a personal preference, but I always prefer api (methods) over hash
> molestation.

Doesn't this work?

   $c->stash( template => 'foo' );


For me, I actually prefer directly modifying the stash as a hash since
it's very clear what is happening.  Personal preference, I guess.


-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list