defining a variable in a template that the layout can read
I realized that the only user-visible strings that are in my dancer perl code are the titles for pages. It's because I do stuff like this: template 'foo.tt', { title => 'My Title' }; Is there a way to define title in foo.tt such that the layout template can see it?
On 2011-03-10, at 10:39 AM, Brian E. Lozier wrote:
I realized that the only user-visible strings that are in my dancer perl code are the titles for pages. It's because I do stuff like this:
template 'foo.tt', { title => 'My Title' };
Is there a way to define title in foo.tt such that the layout template can see it?
This should get you on the right track: http://search.cpan.org/~sukria/Dancer-1.3014/lib/Dancer/Cookbook.pod#TT%27s_... Best, Olaf -- Olaf Alders olaf@wundersolutions.com http://www.wundersolutions.com http://twitter.com/wundercounter 866 503 2204 (Toll free - North America) 416 944 8306 (direct)
Perfect, thanks! On Thu, Mar 10, 2011 at 7:50 AM, Olaf Alders <olaf@wundersolutions.com> wrote:
On 2011-03-10, at 10:39 AM, Brian E. Lozier wrote:
I realized that the only user-visible strings that are in my dancer perl code are the titles for pages. It's because I do stuff like this:
template 'foo.tt', { title => 'My Title' };
Is there a way to define title in foo.tt such that the layout template can see it?
This should get you on the right track:
http://search.cpan.org/~sukria/Dancer-1.3014/lib/Dancer/Cookbook.pod#TT%27s_...
Best,
Olaf -- Olaf Alders olaf@wundersolutions.com
http://www.wundersolutions.com http://twitter.com/wundercounter
866 503 2204 (Toll free - North America) 416 944 8306 (direct)
participants (2)
-
Brian E. Lozier -
Olaf Alders