Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Code and html separation - always or mostly doable?

by thraxil (Prior)
on Jun 16, 2004 at 15:50 UTC ( #367284=note: print w/ replies, xml ) Need Help??


in reply to Code and html separation - always or mostly doable?

with a bit of thought, i've found that it's always possible to seperate the business logic and display logic using HTML::Template. (at least it has been for everything i've written for the last 3 or 4 years).

you may need to spend a bit of time coming up with a decent solution, but it almost always pays off. eg, i used to resort to using CGI.pm's popup_menu() to produce <select>s and then just passing them in as html strings. eventually i sat down and thought up a better solution and the result has been cleaner code with more control in the hands of the designer.

also, don't be afraid to subclass HTML::Template and override parts of it. that road has many interesting possibilities.


Comment on Re: Code and html separation - always or mostly doable?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2015-07-07 23:45 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 (93 votes), past polls