首页
开发手册
应用中心
工具
用户中心
Ease Template Serial Execution
English
中文简体
English
上一篇
下一篇
### Ease Template Serial Execution Programmers with years of development experience understand that dynamic programs are undoubtedly slower than static programs. How to improve the speed of dynamic programs is a very complicated problem. Ease Template adopts an original program serialization execution. Indispensable to the development of a website are the header, content area, and footer. Most websites have more than three pages. The traditional way is to compile three files and then load them separately, and display the results after combining them. Ease Template adopts a new method: when using the cache mode, ET will compile multiple pages in the view code into a cache file, which greatly reduces the number of file loads and improves execution efficiency. It should be noted here that after loading each template, $tpl->n() is applied **Usage of Output under Template** `$tpl->p(); display the results of the current template directly` `$tpl->r(); return template output result` `$tpl->n(); Serialized partial template results` Using the n() method, you must use p() or r() to output the result at the end of all pages, and provide the output name when printing, otherwise it cannot be compiled into a single file. Please refer to the usage below. test_10.php ``` set_file('test_head'); $tpl->n(); //Serial homepage $tpl->set_file('test_index'); $tpl->n(); //serial footer $tpl->set_file('test_foot'); $tpl->n(); //Set the generated compiled file name to test_10 $tpl->p('test_10'); ?> ``` view/test_head.htm ```
header information
``` view/test_index.htm ```
home page information
``` view/test_foot.htm ```
footer copyright
```