tp6 静态页面如何生成

浏览:1014 发布日期:2020/06/23 分类:ThinkPHP6专区
tp6 静态页面如何生成
tp6 静态页面如何生成
那位大神指导下
public function buildHtml($htmlfile = '', $htmlpath = '', $templateFile = '')
{
$content = $this->fetch($templateFile);
$htmlpath = !empty($htmlpath) ? $htmlpath : './app/';

$htmlfile = $htmlpath . $htmlfile . '.'.config('url_html_suffix');

$File = new \think\template\driver\File();
$File->write($htmlfile, $content);
return $content;
}
tp5中这个方法可以使用tp6就不行了
最佳答案
评论( 相关
后面还有条评论,点击查看>>