Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: CGI::Application, Templates, and CSS

by rob_au (Abbot)
on Feb 01, 2002 at 03:18 UTC ( [id://142580]=note: print w/replies, xml ) Need Help??


in reply to CGI::Application, Templates, and CSS

The framework offered by CGI::Application is very straight-forward and direct and from my experience, allows you to prototype applications very quickly.

While its true that CGI::Application has been built with a bias towards usage of HTML::Template for templating, there is absolutely nothing to stop you from using the Template Toolkit.

Indeed, you can implement the usage of Template Toolkit within CGI::Application via two means:

  • Build your own class on top of the CGI::Application base class, overwriting the load_tmpl method with your own template initiation module - This is a very easy thing to do given the design of CGI::Application as a base class. ALternatively, you could initiate the Template Toolkit object within your scope and simply ignore the load_tmpl method inherited from CGI::Application.
  • Subsequently, once the Template Toolkit object exists within the scope of your application, you can return the result of $template->process( $file, $params ) at the end of the application, much in the same way you would with the output method of HTML::Template.

Additionally too, the integration of CSS with your templates should be encouraged as you then have the benefits of not only the separation of code and interface (CGI::Application and Template Toolkit), but also interface separation of content and context (HTML and CSS).

 

perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://142580]
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: (4)
As of 2024-03-29 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found