ethan-chen-li / think-template-swoft
the php template engine for swoft 2.x
Installs: 162
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/ethan-chen-li/think-template-swoft
Requires
- php: >=7.1.0
- psr/simple-cache: ^1.0
This package is auto-updated.
Last update: 2025-10-29 03:03:21 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方法或其他方法,不保证功能正常。 模板标签完美支持。
详细用法参考开发手册