企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
* [ ] 引入文件,编译模板 ``` html($File = null, $Type = false) ``` File(null|string|bool|array):文件名 `@开头=zqphp框架目录,#开头=启动目录,~开头=项目目录,/开头=View根目录` Type(bool):是否生成静态 (Config中的生成静态开关打开了,生成静态才生效)`此参数和Frame::ViewFIle方法功能一样` ***** ``` <?php class index { use \TempLets;//使用模板类要使用use引入 public function main() { $this->assign('userarray', ['id' => 8, 'username' => 'admin']); //在index中使用{file='aa.php'}引入文件,aa.php是指和index同级目录,/aa.php是指View目录 //视图文件中引入文件支持@,#,~ $this->html('index');//单个文件 $this->html(['top','index','foot']);//多个文件 } } ``` ``` //View视图文件 {$userarray.id} //输出8 {$userarray.username} //输出admin ```