Re:RE: Smarty and speed
| From: | Brian E . Lozier | Date: | Sun, 09 Dec 2001 20:55:33 +0000 |
| Subject: | Re:RE: Smarty and speed | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2222@lists.php.net to get a copy of this message | ||
I don't understand this conversation. The language built into Smarty is designed to manipulate
the OUTPUT.
What the user sees. It's not designed to handle things like adding or removing information
from a database.
It's not designed for user authentication. It's not designed to allow the programming of
a shopping cart
application, or an online photo album. It's not designed to generate images, or parse XML
files.
Template engines are designed to separate the application logic from the output, simple as that.
The logic
that Smarty allows is powerful enough that the DESIGNERS can have complete control over how the web
site
looks, without having to delve into my PHP files. They don't have to worry about database
access or input
verification. They only work on the design! The logic in there can be used for things like
displaying a
login box if they're not logged in, or a confirmation if they are. It can be used to iterate
over a
recordset, but guess what? The designers don't care! They code (in HTML) the way the table
should look, and
the programmers are in charge of making sure the data gets there.
What's more, in my application, at least, I can give the designers complete access to the
/templates folder,
and they can do whatever they want to the design, and they never have to look at the PHP. They can
change
the entire look of the site by modifying a few templates. If you were using a straight PHP
implementation,
you'd have to go back and modify every single solitary PHP file on your site. In the end, I
will have dozens
of PHP pages, but to change the look of the site... guess what? I just have to get the designers to
modify
main.tpl.
For me, it took programming w/out a template engine for a while to understand the point and the
beauty of
them. I went from embedding my HTML in my php pages to fast templates, to phplib templates, and
finally, to
Smarty. If you can't see the benefits of a template engine, don't use one! Eventually,
you'll see the need,
and if your site turns out to have as many pages as mine does (7000+), you'll SERIOUSLY wish
you had used
templates originally (believe me, I'm still regretting not using templates... but at least I
have an excuse:
I didn't even know wtf a template was!).
Brian
========================
The Massassi Temple
http://www.massassi.net/
"How should I know if it works? That's what beta testers are for. I only coded it." -
Linus Torvalds
----- Original Message -----
From: "Brent R. Matzelle" <bmatzelle@yahoo.com>
To: smarty@lists.ispi.net
Date: 12/9/01 12:40:00 PM
>
>--- Pablo <phpshop@phpshop.org> wrote:
>> Your comments are not fair. Templating has obvious advantages and
>> we see
>> that very clearly.
>
>If you believe that PHP is a true templating language then you do not
>understand. PHP is a programming language for many reasons (API,
>OOP, etc). I know this because I program in many "true" programming
>languages: C, C++, Java, Python. Smarty abstracts an incredible
>amount of the sophistication of PHP just as XSLT does.
>
>> Why do I mention this? Well, as you pointed out "separation of
>> back end PHP
>> code from presentation" is important. But when using Smarty all
>> you really
>> accomplish is to replace PHP with another language( i.e. Smarty).
>> This means
>> your designers still need to learn how to "program". Albeit with a
>> different language.
>
>That is not true. The only thing that designers have to know is how
>to use {section}{/section} and {$VARIABLE}. They _never_ do any
>programming.
>
>> I wish you would not blindly accuse people of ignorance.
>
>I did no such thing. I stated my opinion and nothing more.
>
>Brent
>
>__________________________________________________
>Do You Yahoo!?
>Send your FREE holiday greetings online!
>http://greetings.yahoo.com
>
>---
>You are currently subscribed to smarty as: brian@massassi.net
>To unsubscribe send a blank email to $subst('Email.Unsub')
>Visit Smarty's homepage at
>http://www.phpinsider.com/php/code/Smarty/