Re: [SMARTY] Re: smarty templates vs. php templates

From: Date: Wed, 06 Apr 2005 23:42:37 +0000
Subject: Re: [SMARTY] Re: smarty templates vs. php templates
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12425@lists.php.net to get a copy of this message
As long as we're providing case study like things. I built a web application for a media company. I built it to keep the code as far away from the presentation as I could. Used Smarty of course. The basic design was very modular. Each user accessible page was just an array of modules that it displays. Each module was tied to a class and it's own template. And there was a general page template that all the other page templates were included (or fetch'ed depending...) into. About a week after delivering the code and templates, I discovered that the graphic artist had built a whole new site using the same modules, in sometimes different arrangements. Additional development time for the second site? Zero. Last I heard they were going to build out half a dozen, with no additional effort by development. Cool. On another project we started moving common features into functions. Things like pagination, table sorts, loading modules can all be done with a registered smarty function. This leaves the programmer more time for the tasks that are non-repetitive. If you're building a small web site (less than 10 pages) and you don't plan on changing anything besides copy. And you've already got good programming practices, then (any) templates *might* be overkill. If you have a site with lots of traffic, or lots of pages or both, then templates, especially cached templates start making a lot of sense really quickly. And then there's how well the template approach fits into the design methodology. Typically the designers build out the site, as a mockup in HTML. Then I as a developer get to build the code and database behind the mocked-up site. The HTML mockups basically become the templates, with little to no additional work for the designer. Heck at this rate neither the designer or the developer will need to do anything, sites will just come together on their own!! Chris On Apr 6, 2005, at 7:44 AM, pete M wrote:
David Ngo wrote:
At my work I work with a html designer and one other programmer. Both of them refuse to learn to use Smarty and keep arguing that we should do away with it. My boss's take on it is that Smarty adds complexity with little benefit. Their solution is to just do away with the templates and instead have php include files with html in them that will act as the templates. We also have a proposed solution using xml that can replace the caching options that Smarty has built in. I have to come up with a few examples where using Smarty is a better solution. Does anyone have any extremely convincing examples I can use to change these people's minds? All of the examples I have seen on the Smarty site and through google are very simplistic examples that could easily be replaced by php includes. I do not want to move away from Smarty because I feel it makes my code better structured, easy to read, and just forces me to have better coding habits. However how do I explain to someone that has never used Smarty and refuses to learn it that it is the way to go? I fear that if I can't come up with some good examples we will switch to the system of using php includes as templates which I do not like at all.
I use Smarty at work and its wonderful. I do the coding with php and pear db My collegue does the html templates and CSS The graphic designer does the images and we never clash it was a nightmare previously and Smarty has made us at least 200% more productive in terms of time and quality icon_wink.gif)) Ta Monte icon_wink.gif pete -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.smarty.general (#12425) next »