Re: Using PHP/HTML effectivly
| From: | Larry Garfield | Date: | Thu, 15 Jun 2006 07:16:01 +0000 |
| Subject: | Re: Using PHP/HTML effectivly | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238045@lists.php.net to get a copy of this message | ||
On Thursday 15 June 2006 01:50, Richard Lynch wrote:
> I can guarantee that somebody on this list is going to be agahst at
> this recommendation of such a crude solution -- But it has served me
> well for a decade for SIMPLE WEB APPLICATIONS and is much less effort
> and more maintainable simply by scale/scope of code-base for SIMPLE
> WEB APPLICATIONS.
>
> If you're attempting to write the next Google or something on that
> scale, then this *IS* admittedly a horrible idea.
>
> For a beginner, however, you'll learn a lot more, a lot faster doing
> this than trying to stumble through some over-engineered monstrosity
> template library.
>
> Now I'd better really get out my flame-retardant undies.
Another recommendation: Do not, under any circumstances, try to write your own
template engine. All you'll be doing is writing a syntax parser in PHP for
another syntax that will give you fewer options, less flexibility, and worse
performance than well-used native PHP.
There ARE good PHP based template engines out there (Smarty, Flexy, PHPTal,
etc.), written by people much smarter than you or I and field tested by
thousands of people on more sites than you've ever used. If you want to use
a non-PHP-syntax for your template files, find one. Don't write it. You
will thank yourself later.
--
Larry Garfield AIM: LOLG42
larry@garfieldtech.com ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson