ethan-chen-li / think-template-swoft
the php template engine for swoft 2.x
v0.3
2019-11-01 10:01 UTC
Requires
- php: >=7.1.0
- psr/simple-cache: ^1.0
This package is auto-updated.
Last update: 2024-05-29 04:49:22 UTC
README
基于XML和标签库的编译型模板引擎
基于Thinkphp官方修改
该版本为开发版本,不保证功能长期支持。
安装方法
composer require ethan-chen-li/think-template-swoft
使用方法:
$dir = __DIR__."/../../"; $config = [ // 模板文件目录 'view_path' => $dir.'/resource/views/', // 模板编译缓存目录(可写) 'cache_path' => $dir.'/runtime/template/', // 模板文件后缀 'view_suffix' => 'html', ]; $template = new Template($config); $data=[]; return $template->fetch("list",$data);
请勿使用assign方法或其他方法,不保证功能正常。 模板标签完美支持。
详细用法参考开发手册