2006/6/28, Jon Anderson <jon@xxxxxxxxxxxxxxxxxx>:
I really don't understand why people have such disregard for PHP as a template system... I'm not saying one way is better or worse (it's really a matter of preference), just that the PHP way isn't implicitly bad or messy... /* The Smarty way */ $smarty->assign('display_variable',$display_variable); ... {* template *} <dl> {foreach key=key item=var from=$display_variable} <dt>{$key}</dt><dd>{$var}</dd> {/foreach} </dl> /* The PHP way */ <dl> <?php foreach ($display_variable as $key => $var) { ?> <dt><?= $key?></dt><dd><?= $var ?></dd> <?php } /* end foreach ($display_variable) */ ?> </dl> Is it really *that* bad? jon Martin Alterisio wrote: > 2006/6/28, Robert Cummings <robert@xxxxxxxxxxxxx>: >> >> On Wed, 2006-06-28 at 07:32, Martin Marques wrote: >> > On Wed, 28 Jun 2006, Ligaya Turmelle wrote: >> > >> > > Martin Marques wrote: >> > >> Why not try to use one of the template systems that already exist? >> > >> HTML_Template_IT, Smarty, etc. >> > >> >> > > Or just use PHP... >> > >> > Because.... it's a mess. >> >> Agreed. Mr. nail, come meet Mr. hammer :B > > > And keep Mr. hammer away from Mr. finger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Have you (all of you questioning the use of templates) ever worked in a project with more than one developer, where part of the team ARE NOT coders? WE understand code, but that's not the case for everyone else. Graphic designers don't like code, they even don't like html for crying out loud (I think they have a good point there btw). Editor, writers, marketing people they all give a damn about php and the like, but, still they need or want to mess up with how things look like, and they really don't like the idea of having to wait two laboral days to change the fricking color of a link, or have an newsletter email typo corrected. They need templates, they love templates. Just put it in dreamweaver (or the like), fix the look, upload and we're back on business, why the hell should I have to call the damn coder? The net has been developed by amateurs long enough (no offense, just introspective). If we are to became more professional, we'll need the right tools, templates is just one of those tools.