Re: Best PHP Template System

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

 



On Thu, Apr 26, 2012 at 12:07 AM, Yared Hufkens <y423d@xxxxxxxx> wrote:
>
> Why use an external engine which slows your scripts down to do something
> which can easily be done by PHP itself? PHP is imho the best template engine
> for PHP.
> With PHP 5.4, it became even easier because <?=$do->somestuff()?> can be
> used without short_open_tag enabled.
> However, you always schould divide UI and backend.
>

Hi,

If you like to write an xml-template by having purely xml, you could
also use OPT (Open Power Template).

You can f.e. add a attribute to a tag by decision by writing this code:

<div>
    <opt:attribute name="class" value="highlight" opt:if="$highlightDiv"/>
    Content
</div>

Feels a bit cleaner to me than writing

<div <?php if ($highlightDiv) : ?>class="highlight"<?php endif; ?>>
    Content
</div>

-- 
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