[Catalyst] Context sensitive template locations

phaylon phaylon at dunkelheit.at
Mon Nov 21 01:46:57 CET 2005


Johan Lindström said:

> Maypole has this template hierarchy where you can have a directory tree
> with templates that match your class hierarchy. Like:
>
> ./edit.tt
> ./Foo/edit.tt

package MyApp::Controller::Foobar;
sub snafoo : Local { }

will be called on /foobar/test, which creates a $c->req->match of
"foobar/test". If you're not specifying $c->stash->{template}, most views
(at least TT) would now look for "$template_path/foobar/snafoo" as
template file. If you set TEMPLATE_EXTENSION in your view's configuration
it would append that to it.




More information about the Catalyst mailing list