haoyundada / haoyundada-view
haoyundada wordpress theme template driver
v1.0.1
2024-09-28 10:21 UTC
Requires
- php: >=8.0.0
- haoyundada/haoyundada-template: ^1.0
This package is not auto-updated.
Last update: 2025-04-27 11:45:55 UTC
README
haoyundada-Template模板引擎驱动
安装
composer require haoyundada/haoyundada-view
用法示例
本扩展不能单独使用,依赖haoyundada framework
首先配置config目录下的template.php配置文件,然后可以按照下面的用法使用。
use haoyundada\facade\View;
// 模板变量赋值和渲染输出
View::assign(['name' => 'haoyundada'])
// 输出过滤
->filter(function($content){
return str_replace('search', 'replace', $content);
})
// 读取模板文件渲染输出
->fetch('index');
// 或者使用助手函数
view('index', ['name' => 'haoyundada']);
具体的模板引擎配置请参考haoyundada-template库。