Re: templating

From: Date: Thu, 22 Jun 2006 11:40:07 +0000
Subject: Re: templating
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-238507@lists.php.net to get a copy of this message
At 08:10 AM 6/22/2006, Ryan A wrote:
Hi, A pal of mine needed some help on his project, he is using a "header" and "footer" file to "template" his project... but its gotten a bit complicated as he has a few dynamic parts in the header and footer files, so I told him to go with a proper templating method of templating the whole page rather than includ()ing the top and bottom. After having a better look at his scripts, I am just not sure if something big (like SMARTY for instance) would be good for him. He just needs maybe 5 template pages, same pages, different color. Searching google I see literally hundreds of "templating solutions" can anyone recommend a simple one or should I tell him to just use str_replace() for tags like: {{menu_here}} {{header_here} etc? Something like SMARTY would be like using a nuke to kill a fly (IMHO) esp since this project will not expand to anything much bigger or complicated. Thanks! Ryan
Ryan, Don't forget, PHP itself is a templating language. Just do a standard page, with includes for headers and footers, menus, and content. If he wants to change colour, then load a different stylesheet for a given page or content section. This way he can use the tool that's right in front of him, he's not adding another layer, he does not have to learn another "language" - the template system written in PHP, and he hones his PHP skills. Whew! Hope this is helpful. Regards - Miles -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.394 / Virus Database: 268.9.2/372 - Release Date: 6/21/2006

« previous php.general (#238507) next »