[Catalyst] selectively using the wrapper

Bill Moseley moseley at hank.org
Wed Sep 16 19:46:38 GMT 2009


On Wed, Sep 16, 2009 at 9:11 AM, Ascii King <tech at swattermatter.com> wrote:

> Bill Moseley wrote:
>
>>
>> In my mind the wrapper is a view issue, so I set the wrapper in the
>> template not in the controller.  I have a wrapper that is called for *ev=
ery*
>> page that is used to build the page.
>>
>> META is compile time, IIRC, so I use [% page.layout =3D 'foo' %] then in
>> wrapper.tt <http://wrapper.tt> I have a CASE statement that
>> sets the wrappers based on page.layout set in the base template.
>>
>> IIRC, I use page.layout (instead of say just "layout") because WRAPPER
>> does a shallow localization of the stash.
>>
>>
> Thanks again, guys.  It took me a few reads to figure out what this meant,
> but I'm glad I understand it now. I agree that the wrapper should be call=
ed
> from the template. I suspect it will make my life a little easier.


Not sure what you mean by "template" there, but maybe this makes it clearer:

 View::TT:
    COMPILE_DIR: __TEMPDIR(templates)__
    WRAPPER: page/wrapper.tt
    PRE_PROCESS: config.tt
    PRE_CHOMP: 0
    POST_CHOMP: 0
    TIMER: 0
    STAT_TTL: 60
    ENCODING: UTF-8

Template Toolkit then will call page/wrapper.tt for template passed to
process().  Then the template sets the page.layout and
page/wrapper.ttdecides how to build the entire page based on that
layout.





-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090916/b4e7f=
aab/attachment.htm


More information about the Catalyst mailing list