ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 编译缓存 模版文件被解析后,会临时保存到: ~~~ 网站根目录/Temp/Compile ~~~ 并且如果模版文件没有改变并且编译文件存在,不会重新编译,而是直接运行编译文件,提高运行速度 编译文件会将模版标签替换为PHP原生代码 替换前: ~~~ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"/> <title> index </title> </head> <body> <h1> smarty </h1> <h2><?php echo time(); ?></h2> <h1>{$name}</h1> <if condition="$person[0]['name']=='taotao'"> <h1>if taotao</h1> <elseif condition="$person[0]['name']=='taotao2'"/> <h1>if taotao2</h1> <else/> <h1>if taotao3 </h1> </if> <foreach name='person' item='v' key='k'> <h1>name:{$v['name']} age:{$v['age']}</h1> </foreach> <include file="templates/footer.html" /> </body> </html> ~~~ 替换后: ~~~ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"/> <title> index </title> </head> <body> <h1> smarty </h1> <h2><?php echo time(); ?></h2> <h1><?php echo $name; ?></h1> <?php if($person[0]['name']=='taotao'): ?> <h1>if taotao</h1> <?php elseif($person[0]['name']=='taotao2'): ?> <h1>if taotao2</h1> <?php else: ?> <h1>if taotao3 </h1> <?php endif; ?> <?php if(is_array($person)): foreach($person as $k=>$v): ?> <h1>name:<?php echo $v['name']; ?> age:<?php echo $v['age']; ?></h1> <?php endforeach; endif; ?> <h1>footer----<?php echo $name; ?></h1> </body> </html> ~~~