On Wed, Jan 30, 2002 at 04:13:31PM +0100, Oscar Serrano wrote: > I've been using TT2 for a short time. I love it. But I've seen in a > previous message, somebody was using the CGI.pm plugin so he can write this: > I don't really understand it. I thing the great thing of TT2 is that you > can write pure (or almost pure) HTML so you don't have to program within > the presentation tier.
Personally, I see using CGI to generate HTML as a good thing for several reasons. Particularly for form elements, I *like* the CGI.pm syntax. I'm often dealing with forms where the elements are dynamic - e.g. you're picking from a drop-down of allowable values generated from a database. I find it much easier to make one call to CGI which can handle things like defaults and labels for me, than to have to write loops that keep checking if the current value is the one that should be selected etc. (I also mostly like the 'sticky' forms nature, but that's sometimes a pain...) Also, using CGI makes my HTML more 'correct' (I don't need to worry about forgetting to quote things that really should be etc.) and also forwards compatible - for example the switch from HTML to XHTML - I didn't have to go back through and change all my <BR> tags to <br /> or <br \> [I also always put the wrong one there!] > As an experienced programmer, when your project starts to grow you like to > have a three-tier model, and the most separated the presentation tier the > most robust your application is. So, why put code within the template when > it is not _completely_ necessary? Absolutely agree. However, I don't see using CGI.pm to generate HTML as application logic. To me it's display logic ... Tony -- -------------------------------------------------------------------------- Tony Bowden | [EMAIL PROTECTED] | http://www.tmtm.com/ we'll find some other crazy dream tomorrow --------------------------------------------------------------------------
