public function buildHtml($htmlfile = '', $htmlpath = '', $templateFile = '')
{
$content=View::fetch($templateFile);
$htmlpath = !empty($htmlpath) ? $htmlpath : './appTemplate/';
$htmlfile = $htmlpath . $htmlfile . '.'.config('view.view_suffix');
$File = new \think\template\driver\File();
$File->write($htmlfile, $content);
return $content;
}第二步 调用 Viewuse think\facade\View;第三步 前端使用 $this->buildHtml('index',HTTP_PATH."index/",$tempSrc); //1.文件命名 2.保存地址 3.需要生成文件文章转发:https://www.hbsjsd.cn/art/list/341.html
最佳答案