美食/液体

CakePHP 3 的液体模板

安装: 10

依赖: 0

建议: 0

安全: 0

星级: 3

关注者: 3

分支: 1

类型:cakephp-plugin

v1.0.0 2015-03-27 14:20 UTC

This package is auto-updated.

Last update: 2024-08-28 01:24:30 UTC


README

Build Status Total Downloads License

旨在启用 Liquid 模板在 CakePHP 3 中。

安装

使用 Composer

composer require gourmet/liquid:~1.0

然后需要加载插件。在 boostrap.php 中,类似于

\Cake\Core\Plugin::load('Gourmet/Liquid');

然后您可以定义任何控制器(或邮件)视图类,如下所示

// in ProductsController.php beforeFilter
$this->viewClass = '\Gourmet\Liquid\View\View';

// passed to any email configuration as the 'viewRender' key and use it:
Email::config(['user' => ['viewRender' => '\Gourmet\Liquid\View\View']]);
$email = new Email('user');
$email->template('Hello {{ name }}', "{{ 'content' | fetch }}\n\nThis is an automated email.")
    ->to('baker@cakephp.org')
    ->viewVars(['name' => 'Baker'])
    ->send();

更多文档/过滤器/标签即将到来。

在此期间,您可以在此 了解此插件所包含的库的更多信息,以及关于 liquid 标记在此 和在此

就是这样!

补丁和功能

  • 分支
  • 修改、修复
  • 测试 - 这很重要,所以它不会意外地损坏
  • 提交 - 不要修改许可证、todo、版本等。(如果您更改了任何,请将它们提升为我可以忽略的单独提交)
  • 拉取请求 - 主题分支的额外积分

错误和反馈

http://github.com/gourmet/liquid/issues

许可证

版权(c)2015,Jad Bitar,并许可在 MIT 许可证 下。