You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
郭向斌 53c180105a
'init'
2 years ago
..
src 'init' 2 years ago
LICENSE 'init' 2 years ago
README.md 'init' 2 years ago
composer.json 'init' 2 years ago

README.md

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

think-view

ThinkPHP6.0 Think-Template模板引擎驱动

安装

composer require topthink/think-view

用法示例

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

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


use think\facade\View;

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


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

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