Liquid templates for CakePHP 3

Installs: 10

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 3

Forks: 1


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

This package is auto-updated.

Last update: 2023-05-27 22:48:53 UTC


Build Status Total Downloads License

Built to enable Liquid templates in CakePHP 3.


Using Composer:

composer require gourmet/liquid:~1.0

You then need to load the plugin. In boostrap.php, something like:


You can then define any controller (or email) view class like so:

// 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.")
    ->viewVars(['name' => 'Baker'])

More documentation/filters/tags to come.

In the meantime, read more about the library this plugin wraps over here and about the liquid markup here and here.

That's it!

Patches & Features

  • Fork
  • Mod, fix
  • Test - this is important, so it's not unintentionally broken
  • Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits of their own that I can ignore when I pull)
  • Pull request - bonus point for topic branches

Bugs & Feedback



Copyright (c)2015, Jad Bitar and licensed under The MIT License.