Re: [SMARTY] new link
| From: | Ken Yarnall | Date: | Sun, 08 Dec 2002 16:20:39 +0000 |
| Subject: | Re: [SMARTY] new link | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6695@lists.php.net to get a copy of this message | ||
> > There is a new link on the Smarty home page saying "why use it?",
> > please read and give me feedback. Tell me things that might be good to
> > add/change etc. If you're a good technical writer, please feel free to
> > help or do a complete rewrite, as I don't claim to be. :-)
> >
> > Monte
I use Smarty, like it, and will continue to use it. I've encouraged my
students to use it as well.
The link mentioned above defends the use of template languages in general
(and occasionally Smarty in particular). That's fine, and the arguments
are sound. BTW, s/anyways/anyway/ at the end of paragraph 1.
The thing I'd like to see addressed (that I've not seen, and which is
periodically brought up) is,
"Okay, separation is a Good Thing, and I want to separate presentation
from "business logic." As you mention, Smarty allows this but does not by
itself enforce it. My question is this: Why not use PHP as the tempate
language? Write PHP-only, business logic scripts that include templates
written in html with simple embedded PHP."
What advantage does Smarty have over PHP as a template language?
Remember, I'm assuming that whichever I use, I'll employ separate logic
and presentation layers. Your argument at the beginning of the above link
doesn't really address this (about a CMS system and security) --- that's
about what files I give a developer access to, not about what language
they're written in.
If the answer is all about language, then I suppose the argument must be
that Smarty (as a language) is easier to learn for designers than a
suitable PHP subset would be. I'd like to hear people's thoughts on that,
particularly when it comes to looping with {section}.
I think the above is the best question I've seen raised concerning use of
Smarty. A direct response to it would make a fine addition to the "why
use it?" link.
Cheers,
Ken
--
Ken Yarnall
Dept. of Mathematical Sciences Lebanon Valley College
Assoc. Professor of Math and CS (717)867-6085 yarnall@lvc.edu