Il giorno ven, 15/06/2007 alle 09.58 -0400, Christopher H. Laco ha
scritto:
> Bill Moseley wrote:
> > On Fri, Jun 15, 2007 at 09:36:33AM -0400, Christopher H. Laco wrote:
> >> The concept is easy, add :Template() to a controller method. Catalyst
> >> automatically stoes that in the action->attributes. Then 'something' has
> >> to do  stash->{template} ||= action->attributes->{Template}.
> > 
> > So you would use:
> > 
> >     sub edit : Local : Template( 'edit.tt' ) {
> >         my ( $self, $c ) = @_
> >         ...
> >     }
> > 
> > instead of:
> > 
> >     sub edit : Local {
> >         my ( $self, $c ) = @_
> >         $c->stash->{template} = 'edit.tt';
> >         ...
> >     }
> > 
> > Or leaving it off and let View:TT create the template name
> > automatically from the action?
> > 
> > 
> 
> Yes. You can use both. Setting stash template always overrides the
> default Template() attribute for that current action via ||=

Putting it in another way, it would be the view side to Path, overriding
the default which maps action /foo/bar/foobar to method
MyApp::Controller::Foo:Bar::foobar and the latter to template
foo/bar/foobar... Yes, I like it :)

-- 
Leo "TheHobbit" Cacciari

Attachment: signature.asc
Description: Questa รจ una parte del messaggio firmata digitalmente

_______________________________________________
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