* Justin French <[EMAIL PROTECTED]> [2004-04-15 00:37:41 +1000]:

<snip>
> You must remember, Smarty is just a layer over PHP.  All the functions 
> that you've listed exist in pure PHP code somewhere.  It would 
> relatively easy to code equivalent templates in PHP.
Yes, you're right.

But then it should not be called a template engine, but instead a special
php dialect.

> Taking some random examples from your list:
>       {foreach from=$custid item=curr_id}
>       id: {$curr_id}<br>
>       {/foreach}
>       becomes
>       <? foreach($custid as $curr_id): ?>
>       id: <?=$curr_id?>
>       <? endforeach; ?>

Well, in patTemplate this is much cleaner and easier to understand
for non-programmers.

template:

<patTemplate:tmpl name="foo">
    blah
    <patTemplate:tmpl name="list">
        id: {id}
    </patTemplate:tmpl>
</patTemplate:tmpl>

code:

$tmpl->addVar ( 'list', 'id', array ( 1001, 1002, 1003, 1004 ) );
$tmpl->addVar ( 'list', 'name', array ( 'joe', 'jack', jane', 'charlie' ) );


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT services

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     [EMAIL PROTECTED]
  cellphone: +49 174 7066481
---------------------------------------------------------------------
   -- DSL-Zugang ab 0 Euro. -- statische IP -- UUCP -- Hosting --
---------------------------------------------------------------------

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

Reply via email to