[Catalyst] :Template() Attribute

Zbigniew Lukasiak zzbbyy at gmail.com
Mon Jun 18 14:59:30 GMT 2007

On 6/18/07, John Napiorkowski <jjn1056 at yahoo.com> wrote:
> For example I
> have cases where for all templates in a given
> directory I want to set a particular WRAPPER for my
> Template toolkit, etc.
I don't quite understand what you mean here - but I thought it should
cover this case in the same way that method inheritance covers it when
you work with objects.

You put WRAPPER => wrapper.tt in the view config and then you create
the base controller - put a wrapper.tt into it's template directory.
When you inherit from that controller you can use that inherited
template.  Or you can override the template by putting some new code
into a file called 'wrapper.tt' into the new controllers template
directory.  This is the same thing you do with methods - you can
inherit them or override them.

Ideally this should take into account the use of 'use base' in the
controller packages - but splitting $c->action->namespace - as Matt
proposes can be acceptable.


More information about the Catalyst mailing list