Re[2]: [PEAR] Smarty vs PEAR::HTML_Template_IT

From: Date: Tue, 17 Dec 2002 19:54:57 +0000
Subject: Re[2]: [PEAR] Smarty vs PEAR::HTML_Template_IT
References: 1 2 3 4 5 6 7  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3024@lists.php.net to get a copy of this message
JH> Now lets look at some utility aspects of using Smarty as a JH> template engine. Take this for example: JH> {image name="masthead.gif"} JH> This is using a custom template function called "image". The JH> template engine will render this to the browser as such: JH> <img src="masthead.gif" border="0" height="48" JH> width="256"> Yes, of course. But i think it was a sample that illustrates the usage of custom functions. I have never worked with it and i don't intend to. Anyway, in that situation, this is where a prefilter can be perfect: you write something like: <img smarty="true" name="masthead.gif" border="0" /> and have the prefilter change it to {image name="masthead.gif"} The WYSIWYG editor would be happy, so would be the designer, and so would you be :) JH> Correct me if I'm wrong, but you say you write the JH> application/website first including a dummy template with logic JH> etc. already built in. I work exactly the other way around, JH> because I think the design should be more or less finished first. JH> The design also serves as a prototype so you can talk to the JH> client about the functionality. We usually try to prepare a "paper" version of the site / app 's with every screen described, until the client is satisfied, then we stick on it. Usually, the design gets worked on while we are developing, so... JH> I wait before I start coding because the customer may realize, as JH> he is playing with the prototype screens, that he wants to JH> display/record different data which could require you to change JH> your DB schema and code. (and they want you to do it for free too JH> and you get into nasty money related arguments and in the end you JH> get the blame because you charge more then you originally quoted JH> blah blah) Sounds like a known situation to me... the hell of it :) JH> Then when they are happy I start building the code that retrieves JH> and inserts the real data. I guess it doesn't matter much as long JH> as you and the customer agree on how the application/website JH> should work before you so any work. Anyway, it's always possible to work on a simplified version of the pages, including only a basic positioning and the template logic, until all the code is written. Then you can integrate it in the real design. But I agree, the "graphical development" integration of templates solution is a complex question (in fact, it's the same with classical development...). I don't know if there's a perfect solution, though. I just think that development with Smarty offers enough customization features over any part of the workflow to make it usable in a production situation. Katana

« previous php.pear.general (#3024) next »