Re: template engine...why???

From: Date: Wed, 30 Apr 2003 20:24:23 +0000
Subject: Re: template engine...why???
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-145855@lists.php.net to get a copy of this message
Simple web pages that doesn't need more than values like in ur example can be done in easily. I'm not talking about such pages, I'm talking about complicated web applications which need a lot of customize, let me give you some examples: suppose I've created a function articleTitle which prints the article title and another one which is articleContents, if the designer is easy-going he'll accept to use <? articleTitle() ?> and <? articleContents() ?> but if he's a creative one (or the client is moody) he'll come up with many ideas like: "I want the title to be limited to 80 chars in this position while keeping it as it is in that position" that means I should either create two functions or make my function customizable eg: articleTitle(80) or articleTitle().. ok solved, after few days he may come to me and say I want it to be ucwords'ed.. I will tell him ok just use ucwords(articleTitle()).. and another time he found that he wants articleContents to be wordwrap'ed in some page and htmlstrip'ed in another.. (I will simply tell him go learn PHP!) Another thing, the loops and repeated blocks grant designers a lot of headache moreover when they see non-understandable php codes split their design, Yet dreamweaverMX have solved that a bit.. but a lot of designer still don't prefer to have complicated php codes in their html while they design. There must be a way of making this easier for designers.. and this could be a template system which uses php logic itself while keeping Designers away of complicated ones, oh yes and <? myFunction() ?> is also similar to {myFunction} I'm not against using php itself for making templates, if it was me who designs I would love to use php and php only combined with html, but when it comes to designers who usually don't know PHP, I can't trust leaving them with php-codes in one room. ----- Original Message ----- From: "Steve Keller" <skeller@healthtvchannel.org> To: <php-general@lists.php.net> Sent: Wednesday, April 30, 2003 10:54 PM Subject: Re: [PHP] template engine...why??? > At 4/30/2003 07:56 PM, Salah Faya wrote: > > > I also use a template system is to give the layout designers complete > freedom > > regarding the look without the need to teach them PHP. > > Not to keep beating this discussion, but I'm at a loss for understanding > this argument. If your designers are using CSS-compliant designs, even if > they're using a table or two for layouts, PHP still makes templating easy. > What's to keep them from doing: > > <div id="header"><? heading(); ?></div> > > <div id="content"> > <? menu(); ?> > <? leadArticle(); ?> > <? oldArticles(); ?> > </div> > > <div id="footer"><? footer(); ?></div> > > Is that really so complicated? Your PHP code is in those functions, all the > designers need to know is what the output looks like. And if your output is > clean paragraphs and divs, then the designers can worry about the layout > with CSS. Even if the designers wanted to add more complexity to things > like the headline, you could still hide the PHP behind functions, so all > the designer would have to know is <? theDate(); ?>, or <? theUsersName(); > ?> and so on. > > Can someone please tell me what your designers are doing that's so > fantastically complex? Because I'm not seeing it. > -- > S. Keller > UI Engineer > The Health TV Channel, Inc. > (a non - profit organization) > 3820 Lake Otis Pkwy. > Anchorage, AK 99508 > 907.770.6200 ext.220 > 907.336.6205 (fax) > Email: skeller@healthtvchannel.org > Web: www.healthtvchannel.org > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#145855) next »