第一步在 ba
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;
}
use think\facade\View;
$this->buildHtml('index',HTTP_PATH."index/",$tempSrc);
$this->buildHtml('静态文件', '静态路径','模板文件');
具体自测
发表评论: