...Uh~ Just add a caching mechanism and it will be perfect! I don’t know if the performance of writing this way will be higher than those of template engines that are all regular?
[PHP] code
- $a = array(
- 'a','b','c'
- );
- require 'template/demo.php';//Reference template
- ?>
Copy code
[PHP] code
- Template file:
-
-
- Template test
- =$a[1]?>
Copy code
[PHP] code
- Key value: =$value?>
-
- //Iteration of array
-
- //smarty:
- {foreach item=na from=$a key=key}
- Key value: {$key}
- {/foreach}
-
- //For PHP programmers Which one is easier to understand?
- //smarty also uses regular expressions to parse templates. PHP’s regular expressions are not that efficient...
Copy code
|