Bill Moseley wrote:
> On Fri, Jun 15, 2007 at 09:58:06AM -0400, Christopher H. Laco wrote:
>>>     sub edit : Local : Template( 'edit.tt' ) {
>>>         my ( $self, $c ) = @_
>>>         ...
>>>     }
>>>
>>> instead of:
>>>
>>>     sub edit : Local {
>>>         my ( $self, $c ) = @_
>>>         $c->stash->{template} = 'edit.tt';
>>>         ...
>>>     }
>>>
> 
>> Yes. You can use both. Setting stash template always overrides the
>> default Template() attribute for that current action via ||=
> 
> Maybe I missed this in your first email, but what's the problem you
> are trying to solve?
> 
> 

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.

Just me being neurotic. :-)

-=Chris

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to