exertis / yii2-handlebars
Yii 框架的 Handlebars.php 集成。是 https://github.com/7coders/yii2-handlebars 的分支,该分支神秘地从 GitHub 上消失了。
dev-master
2015-04-07 08:06 UTC
Requires
This package is not auto-updated.
Last update: 2024-09-28 16:36:20 UTC
README
GitHub 上神秘消失的 https://github.com/7coders/yii2-handlebars 的分支
来自原始的 7coders README.md
Yii2 框架的 Handlebars 渲染器。
此扩展提供了一个 ViewRender
,允许您使用 handlebars-php 视图模板引擎。
要使用此扩展,只需将以下代码添加到您的应用程序配置中
return [ //.... 'components' => [ 'view' => [ 'renderers' => [ 'handlebars' => [ 'class' => 'exertis\handlebars\ViewRenderer', // the file extension of Handlebars templates // 'extension' => '.handlebars', // path alias pointing to where Handlebars cache will be stored. Set to false to disable templates cache. // 'cache' => '@app/runtime/handlebars', // array helpers to preload, can contain class names (strings). // If empty - only default helpers will be preloaded // 'helpers' => [], // a callable function to escape values // 'escape' => 'htmlspecialchars', // array to pass as extra parameter to the escape function // 'escapeArgs' => [ENT_COMPAT, 'UTF-8'] ], ], ], ], ];
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一:
php composer.phar require --prefer-dist exertis/yii2-handlebars "*"
或
"exertis/yii2-handlebars": "*"
将以下内容添加到您的 composer.json 文件的 require 部分中。