Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by pKai (Priest)
on Dec 09, 2007 at 14:16 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found