PHP is the simplest and simplest template engine: PHP native template engine

WBOY
Release: 2016-07-25 08:42:12
Original
1143 people have browsed it

...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

  1. $a = array(
  2. 'a','b','c'
  3. );
  4. require 'template/demo.php';//Reference template
  5. ?>
Copy code

[PHP] code

  1. Template file:
  2. Template test
Copy code

[PHP] 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 programmers Which one is easier to understand?
  8. //smarty also uses regular expressions to parse templates. PHP’s regular expressions are not that efficient...
Copy code
The simplest, php, PHP


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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!