Reply to Re: [PHP] Re: Templating engines

Your name:

Reply:


Posted by Robert Cummings on 05/02/05 20:30

On Mon, 2005-05-02 at 13:02, Skrol29 wrote:
> Mattias Thorslund a écrit :
> > Then I wonder what makes skol29 think PHP's "basic template features"
> > are "too poor" to be used seriously? I think PHP's "basic template
> > features" are phenomenal.
>
> PHP is a nice and powerfull scripting langage oriented for Web
> developement. Let's look at what's it can do as a Template Engine.
>
> -> place data items in a template:
> HTML ... <?php echo $myvar ?> ... HTML
>
> -> repeat a zone with data items (*):
> HTML ... <?php for ($i=0;$i<=$iMax;$i++) { >
> HTML ... <?php echo $myvar[$i] ?>
> HTML ... <?php } ?>
>
> -> Hide or display a zone:
> HTML ... <?php if ($test) { ?>
> HTML ... <?php } ?>
>
> -> include an external part or subtemplate:
> HTML ... <?php include('subtemplate.php') ?> ... HTML
>
> And that's it. I think you cannot do more without coding HTML with PHP
> commands, which wouldn't be making a template anymore.
>
> (*) Note that FOR and FOREACH are the only way for repeating a zone of a
> template with basic PHP commands, and that's aleardy an algorithm.
> While placing locators into a template shouldn't mean coding.
> This is at the limit of template feature.

While I'm generally on the template side of the debate and more
specifically on the "use what's best for a given project" side of the
debate, I must argue that I see little problem with display logic in a
template, and that "foreach" is not an algorithm as much as it is an
expression. I mean sure there's some algorithm in the background to
facilitate the traversal, but then there's some algorithm in the
background to display these characters I've just typed and I'd hardly
say I'm programming to bring this response to you :)

Cheers,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация