Re: [PHP Template] Re: [PHP3] Re: [PHP Template] Re: [PHP3] PHP Template Engine spec revision 0.52

[email protected] (Monte Ohrt) Mon, 20 Mar 2000 19:13:41 -0600
Newsgroups php.template
Message-ID <[email protected]>
Hello,

Hopefully I'll be able to clarify some important things to know about this
template engine. You can't just take a glance at the spec and say "it's too
complex", there is a lot of time-consuming thought and input from everyone that
derived the way it is designed.

The engine specifications are designed around the top priority being
ease-of-use, followed by flexibility. The template engine IS easy to use, yet
harnesses the power designers will want once they get comfortable with it. We
wanted to keep the syntax as close to HTML as possible (since the majority of
designers are comfortable with this), yet retain the ability to handle basic
template logic controls.

Andrei and I come from a background where we interact with the designers on a
daily basis. We've tried all sorts of template solutions out there and quite
frankly, none of them cut it. We need to separate form from content, yet give
the designers the flexibility they need to design! Far too often the designers
have one hand tied behind their back because of the limitations the templates
give them. They can't just come tap us on the shoulder every time they have an
idea. Through our experience, the majority of what designers need can be covered
with "includes", basic "if" logic and section looping. This opens a whole new
perspective of options for them without having to learn all the little
idiosyncrasies of the PHP language, not to mention they don't break our code!

Some of the syntax in the template, like the variable name prefixes, came from
the basic need to handle variable type casting and looping logic without
completely confusing the designers. We went around and around to try to figure
out a better way to do it, consulted the mailing list, and this is what we
eventually came up with. If you have a better idea how to do it, we're all ears!
I also thought it was a bit much at first, but after seeing it in action I think
you'll agree that it really isn't that difficult, yet extremely powerful.

It's not just the coders putting this together, designers are on the list too.
There's nothing better than input from the people that will be using it. So far
we have seen nothing but enthusiasm from our designers. They can't wait to ditch
(*insert crippled template lang here*) and use this one!

All in all, I think we're on the right track. This is going to open doors for
PHP that were never before thought possible. The more constructive input we get,
the better it will be. Everyone's input is greatly appreciated. Thanks to
everyone who has helped bring this vision to a reality.

Monte



Sascha Schumann wrote:

> On Tue, Mar 21, 2000 at 01:00:09AM +0200, Zeev Suraski wrote:
> [..]
> > True, but I actually suspect that peopple with a 'strong opinion' would be
> > ones that think templates should be as advanced as possible.  People who
> > think that templates should be plain and simple probably don't care about
> > that enough to subscribe to a new mailing list.
> > As this is a section that, if implemented well, may be considered an
> > integral part of the language, I don't think that just a couple of dozen
> > people should hear about it.  The dedicated mailing list makes sense for
> > the development info, or specific feature debates;  Whether a template
> > system should be very complex and duplicate large portions of PHP's
> > built-in functionality, or plain simple and just let you separate your
> > logic from your presentation (something which is not quite done the way
> > the template spec is laid out now) is a general concept question, and I'm
> > sure many more people would have something to say about it.
>
> Well, while I see the benefit of having an easy to use template engine, I
> frankly don't see why a powerful template engine would harm PHP. What I'd
> like to see is a unified concept which is easy to use and powerful.
>
> I think we should see this discussion as a long invitation for people to
> join the template mailing list. It is not closed, it is wide open to
> contributions by everyone who wants to work constructively on the new
> template engine.
>
> - Sascha
>
> --
> PHP Template Engine Mailing List
> Current engine specification can be found at:
> http://va.php.net/~andrei/tpl-engine-spec.txt
> To unsubscribe, e-mail: [email protected]