Fetch the repository succeeded.
从ThinkPHP5.1独立出来的编译型模板引擎
composer require topthink/think-template
在根目录下创建index.php入口文件测试:
<?php
namespace think;
require __DIR__.'/vendor/autoload.php';
// 设置模板引擎参数
$config = [
'view_path' => './template/',
'cache_path' => './runtime/',
'view_suffix' => 'html',
];
$template = new Template($config);
// 模板变量赋值
$template->assign('name','think');
// 读取模板文件渲染输出
$template->fetch('index');
// 完整模板文件渲染
$template->fetch('./template/test.php');
// 渲染内容输出
$template->display($content);
详细用法参考这里
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。