新版框架默认只能支持PHP原生模板,如果需要使用thinkTemplate模板引擎,需要安装think-view扩展(该扩展会自动安装think-template依赖库)。
composer require topthink/think-view
配置文件
安装完成后,在配置目录的view.php文件中进行模板引擎相关参数的配置,例如:

php文件中赋值
View::assign('user', $user);

html文件中使用模板标签
{if $user.profile_photo_path == null}
<img src="../../../static/admin/template/images/faces/face5.jpg" alt="profile"/>
{else /}
<img src="../../../uploads/avatar/{$user.profile_photo_path}" alt="profile"/>
{/if}
<span class="nav-profile-name">{$user.name}</span>

完整的模板标签(循环、比较、条件)可以参考
循环标签 · ThinkTemplate开发指南 · 看云ThinkTemplate模板引擎开发指南
https://www.kancloud.cn/manual/think-template/1286417
软件工程小施同学
![[AUTOSAR][诊断管理][ECU][$3E] 测试设备在线|会话保持](https://img-blog.csdnimg.cn/b44b336b3f624d36a49ad1deb4617d2a.png)


















