in reply to Catalyst WRAPPER

WRAPPER is a tt2 directive, see Template::Manual::Directives

Replies are listed 'Best First'.
Re^2: Catalyst WRAPPER
by Anonymous Monk on Jun 07, 2010 at 05:43 UTC

    That is only partially useful, as the setting being asked about is actually the setting within Catalyst to specify which file will be used as the default wrapper for all responses.

    xiaoyafeng, I would suggest using conditional logic in the wrapper template itself to override the default (i.e. most commonly used) behaviour by doing something like setting a flag in the stash.

    It is the best I have been able come up with so far and I would be interested to hear about a more elegant solution if it is available.

      The setting happens to be set within a Catalyst view class but it's still purely a Template setting and has nothing specifically Catalyst about it. That's rather the point of the M and the V in MVC. So the best answer to this would probably come from the TT archives/list though the Cat resources have help too, and xiaoyafeng asked there too got a couple decent answers and a pointer to http://wiki.catalystframework.org/wiki/gettingstarted/howtos/template_wrappers.

      A stash variable named "wrapper" to override the view's default is a fine way to go. I recommend against subclasses per wrapper as suggested earlier. One TT view is enough considering how easy it is to customize arbitrary wrappers.