Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 examining the Monastery: (6)
As of 2015-07-04 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls