iboxs/iboxs-view

iboxsphp template driver

1.0.0 2023-09-25 14:47 UTC

This package is auto-updated.

Last update: 2024-08-25 16:45:25 UTC


README

iboxsPHP6.0 IBoxs-Template模板引擎驱动

安装

composer require iboxs/iboxs-view

用法示例

本扩展不能单独使用,依赖iboxsPHP6.0+

首先配置config目录下的template.php配置文件,然后可以按照下面的用法使用。

use iboxs\facade\View;

// 模板变量赋值和渲染输出
View::assign(['name' => 'iboxs'])
	// 输出过滤
	->filter(function($content){
		return str_replace('search', 'replace', $content);
	})
	// 读取模板文件渲染输出
	->fetch('index');


// 或者使用助手函数
view('index', ['name' => 'iboxs']);

具体的模板引擎配置请参考iboxs-template库。