Re: Template Proposal
| From: | Peter Bowyer | Date: | Thu, 08 Nov 2001 21:32:27 +0000 |
| Subject: | Re: Template Proposal | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-2698@lists.php.net to get a copy of this message | ||
Hi Alex,
At 12:33 PM 11/8/01 -0800, you wrote:
we are really not talking about complex concepts here, keys, loops, and blocks...Well, here's the section I was thinking of: {* This generates the code for the thumbnail table *} <table border=0 align="center" width="500">
<tr>
{section name=numloop loop=$data}
<td valign="top" align="center">{$data[numloop]}</td>
{* see if we should go to the next row *}
{if (%numloop.rownum% mod $num_columns) == 0}
</tr>
{* don't start a new row on the last loop *}
{if not %numloop.last%}<tr>{/if}
{/if}
{/section}
</table>
It doesn't take much mucking around to ruin it :-)
And then what if they suddenly want alternating rows different colours? I hope you see what I mean... the PEAR table class would probably have been better, except then I have to change the code if they want to change the design.
but they should be hand-coding their html anyway.. I use dreamweaver for prototypes but would never put such dog-ugly code in production. egh.<lazy>I code using Dreamweaver all the time for sites and just clean it up at the end.</lazy> Not that there's much cleaning up to do - with a modified starting document (DOCTYPE added) it'll produce valid code almost always no different to that which I could have hand-coded. And much quicker as well :) PHP coding is of course _not_ done in Dreamweaver, but in PHPEdit <http://www.phpedit.net> instead. Part of the problem is that I'm designing for lower-than-designers - I want my script to be usable by anyone with basic knowledge of HTML, and things like the {section} block above IMNHO give them too much chance to muck it up. And yet I want to abstract _all_ design from code :-) Regards, Peter. --oOo-- Narrow Gauge on the web - photos, directory and forums! http://www.narrow-gauge.co.uk --oOo-- Peter's web page - Scottish narrow gauge in 009 http://members.aol.com/reywob/ --oOo--