Re: Smarty vs PEAR::HTML_Template_IT
| From: | Jeroen Houben | Date: | Tue, 17 Dec 2002 15:59:40 +0000 |
| Subject: | Re: Smarty vs PEAR::HTML_Template_IT | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3018@lists.php.net to get a copy of this message | ||
>
> JH> I'm more in favor of the "Smarty philosophy" I think, becuase I agree
> JH> that
> JH> there is such a thing as presentation logic and it is the designer's
> JH> responsibilty to work with that. But this is unfortunately not always the
> JH> case. And I'm also not quite sure how Editors like Dreamweaver will handle
> JH> Smarty's {img} tags.
> Afaik, there are - basically - no such tags. At least not that i know about.
> Someone was a while ago talking about an {img} plugin he wrote, but I'm just
> using classical <img> tags.
I have never used Smarty, so I don't know what it can and can't do, but this is from
http://smarty.php.net/whyuse.php:
---------
Now lets look at some utility aspects of using Smarty as a template engine. Take
this for example:
{image name="masthead.gif"}
This is using a custom template function called "image". The template engine will
render this to the browser as such:
<img src="masthead.gif" border="0" height="48"
width="256">
-------------
Correct me if I'm wrong, but you say you write the application/website first
including a dummy template with logic etc. already built in. I work exactly the
other way around, because I think the design should be more or less finished first.
The design also serves as a prototype so you can talk to the client about the
functionality. I wait before I start coding because the customer may realize, as he
is playing with the prototype screens, that he wants to display/record different
data which could require you to change your DB schema and code. (and they want you
to do it for free too and you get into nasty money related arguments and in the end
you get the blame because you charge more then you originally quoted blah blah)
Then when they are happy I start building the code that retrieves and inserts the
real data. I guess it doesn't matter much as long as you and the customer agree on
how the application/website should work before you so any work.
I guess I'm sidetracking from the original issue! oh wel...Another question ;-) I
really like HTML:Quickform, it saves me lots of work. Is there any way to use this
with Smarty or PEAR templates, so the presentation is part of the template for the
page that contains the form? In the examples, the presentation is mixed with the
element creation statements e.g.
$form->setElementTemplate("<!--BEGIN required myHTML blah");
$form->addElement("text".....);
thanks,
Jeroen