Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Abstracting away layout details when using large HTML::Template-based sites?

by pKai (Priest)
on Dec 09, 2007 at 14:16 UTC ( #655958=note: print w/ replies, xml ) Need Help??


in reply to Abstracting away layout details when using large HTML::Template-based sites?

There is HTML::Template::Compiled which, while being compatible to HTML::Template, has a dynamic include feature, which does exactly what you expected above from HTML::Template at this point.

Referring to your code above:

my $filename = "./page.inc"; # or determine dynamically $layout->param( page => $filename );

layout.tmpl

<html> <head> <title><!-- tmpl_var name='title' --></title> </head> <body> <!-- tmpl_include_var name='page' --> </body> </html>

and title will also be expanded in the page.inc part.


Comment on Re: Abstracting away layout details when using large HTML::Template-based sites?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://655958]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-09-19 00:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (128 votes), past polls