Re: Re: Templating engines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux