atah medeber shtiot
[email protected] Wed, 22 Mar 2000 11:11:43 +1000 (EST)
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
hello ze'ev and list,
On Tue, 21 Mar 2000, Zeev Suraski wrote:
> I can understand the use of templates for very straightforward stuff, if
> you want someone that doesn't understand programming to handle your pages
> (which I personally consider questionable as well, but I guess many others
> don't). However, if that someone is bright enough to use the template
> system you're building, he doesn't need to be any smarter or more skilled
> to use PHP itself, which is why I think it's wrong to implement two
> scripting languages on top of one another.
oh dear. where to start.
1. it's a bad idea for someone who can't code in PHP to work on a site
that may use it for logic stuff.
zeev, PHP is my favourite language. i appreciate all the effort both you
and andi have put into it. however, i consider its one major flaw that
there is no proper way to seperate content and logic. i believe andrei,
monte, their company and this list have done an excellent job of putting
together a mechanism that will do that. please don't come along and
say that you don't like it and offer absolutely nothing to replace their
proposal.
2. even if it was a good idea, and they are "bright enough"
to use the template system, they should be using PHP.
the idea of templates is to seperate PHP from content.
there should be no PHP code in a template. the designer shouldn't have to
touch any of the logic PHP code, or ask for help to change
something, or interm(i|a)ngle a programming language with the site
design or content.
think of it as:
coder "exports" variables -+ +- designer
to allow use through |- { accessable variables } -| "calls" vars
template engine -+ +- from template
3. templates are a new language.
templates aren't a "new language". you can't write a program in templates.
andrei's spec offers a (small) syntax with a few simple features
(and a few advanced ones, which are optional to use, just like you aren't
forced to use pconnect, you can use connect instead - but I *know* most
people will use them because they're what's needed in the real world) to
seperate content from logic.
think of it as:
HTML -> CSS
PHP -> Template Engine
cries of "creeping featurism" aren't true either. i think that the spec
is a good example of the best features available from a whole range
of templating systems, plus a few that make it better than any others -
but none of them are "unnecessary".
the decision was made to not include templates in the PHP (zend) parser -
and now someone has come up with a solution that does the job without
it. now you don't like that solution either. what do you propose instead?
- avi