Just make your template engine compile templates to "native" php code.
i.e. write a parser which replaces {if $foo}{$var}{/if} with
<?php if($foo) {?><?php echo $this->templateVars['var'];?><?php } ?>

To check if the template must be recompiled, just compare filemtimes.
The assign function could be look like this then:
=====
function assign($varName, $value = '')
{
    if(is_array($varName))
        foreach($varName as $key => $val)
            $this->assign($key, $val);
    else
        $this->templateVars[$varName] = $value;
}
=====

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

Reply via email to