[Dancer-users] Accessing template variables inside Wrapper (layout)

sawyer x xsawyerx at gmail.com
Fri Dec 31 18:13:07 CET 2010

On Fri, Dec 31, 2010 at 10:54 AM, Deepak Gulati <deepak.gulati at gmail.com>wrote:

> http://www.template-toolkit.org/docs/manual/Directives.html#section_WRAPPER
> "One side-effect of the "inside-out" processing of the WRAPPER
> configuration item (and also the WRAPPER directive) is that any
> variables set in the template being wrapped will be visible to the
> template doing the wrapping, but not the other way around."

We do that as well, but differently.
The way we do it, If you define a variable to a template, it is available to
both the template and the layout.

"It achieves the same effect as defining META items which are then
> accessed via the template variable [...]"

The fix I presented earlier uses the template variable.

So thanks again!

Happy to help! :)

> I am nitpicking here, but probably we should warn/error out if both
> layout: and WRAPPER: configuration options are both active together in
> config.yml

I was contemplating this. I'm not sure we should issue warnings on what we
*think* you aren't suppose to be doing. True, we do set warnings on by
default (as well as strict), because we think it's important and some of
these warnings are just that - things you probably didn't want to do.
However, I'm still on the fence on this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20101231/dfe9da99/attachment.htm>

More information about the Dancer-users mailing list