template engine
| From: | Niels Uhlendorf | Date: | Thu, 19 Jun 2003 14:22:09 +0000 |
| Subject: | template engine | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-152165@lists.php.net to get a copy of this message | ||
Hi,
Since I don't want to continue with Smarty I started with an own (little) template engine. In this first try it should only replace
{for loops=INTEGER} ... {/for} through a trivial FOR-loop which runs INTEGER times.
This mission was sent to the function "loop" in this file:
http://www.offucia.org/pages/template-engine/source.php?file=engine.php
In this file I try to work with it
http://www.offucia.org/pages/template-engine/source.php?file=test.php
But the file loop() cannot be found and theres this mistake error:
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /www/htdocs/v035923/pages/template-engine/engine.php on line 26
Line 26 is this one:
$template = preg_replace("!{for loops=(.*)} (.*) {/for}!U",code($1,$2),$template);
Many thx 4 help
Niels Uhlendorf