Kevin Waterson wrote:


Well basically, Smarty is gay.
Smarty supposedly will seperate code from content.
but you have still need to markup to able to handle loops, conditions etc which puts code right back into the content.
But it is Smarty code and not PHP code, where is the value in that?
The pre-supposition is of course that html designers are idiots when
what is really needed is to teach them some basics about PHP rather
than introducing an entire new (Smarty) concept.
Of course when you build an application with Smarty you get to use buzzwords like multi-tiered, but this slows you down.


I'm no Smarty fan, but there are two aspects which are
rarely, if ever (I'd say NEVER, but 'never say never'!)
brought up in Smarty's defense.

First - if you're dealing with multiple people on a project,
having 'HTML' people use Smarty can prevent them from including
random PHP code, which may email contents of forms to themselves,
etc.  The rebuttal to that (at our office) is that especially
on projects that have multiple people, you should rarely
have people putting stuff on  a live server without peer review
of some sort.

Second - there's a POTENTIAL for Smarty (or any other template
system) to be 'cross platform'.  If you could reuse the same
Smarty template across PHP, Perl, CF, Java, Python, TCL, whatever,
it'd become a defacto standard.  They aren't pushing this.

There is one (ultimatetemplate.com I think) which has
ASP and PHP parsers for the same template syntax system.  Good
idea, but not getting enough attention.

It'd be one of the few reasons I'd recommend someone
learning/using an external template system.


The extensive use of regex within the application cannot be a good thing. The use of tags such as {foobar} could easily be replaced
by <?=$foobar;?> or <?php echo $foobar; ?> and most every thing else
is easily handled with file_get_contents() include() or eval()
I am not saying Smarty is a worthless piece of dog shit, quite, I just
feel it create unneccessary overhead without delivering true seperation
of code and content.
The regexes are only done once per file, until it changes, as
Smarty will take the 'original' version and translate it into
native PHP calls then save that file. I'm not sure
how it handles concurrency on new templates (possibility of race conditions?) but I tend to think most people getting their
ire up over various template systems usually don't have
sites with much traffic anyway. I may be wrong here - it's
more of a hunch than anything else.


Michael Kimsal
http://www.logicreate.com <-- doesn't use Smarty :)
734-480-9961


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to