The simplest and simplest template engine: PHP native template engine

WBOY
Release: 2016-07-25 09:05:00
Original
1098 people have browsed it
...Uh~ Adding a caching mechanism would be perfect! I don’t know if the performance of writing this way will be higher than those of regular template engines?


  1. $a = array(
  2. 'a','b','c'
  3. );
  4. require 'template/demo.php';//Reference template
  5. ?>
Copy code
  1. Template file:
  2. Template test
  3. < pre>
Copy code
  1. Key value:
  2. //Iteration of array
  3. //smarty:
  4. {foreach item=na from=$a key=key}
  5. Key value: {$key}
  6. {/foreach}
  7. //For php program Which member is better understood?
  8. //smarty also uses regular expressions to parse templates. PHP’s regular expressions are not that efficient...
Copy code


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template