twig-craft-cms-filters

2.5.0 • Public • Published

Twig.js Craft CMS Extensions

Build Status

Twig.js implementations of Craft CMS's Twig filters.

Usage

npm i twig-craft-cms-filters
var Twig = require('twig')
const twigCraftCms = require('twig-craft-cms-filters')

// Add Craft CMS filters.
twigCraftCms(Twig);
{{ 'Hello World!'|id }}

Filters

A comprehensive list of the filters is available here.

  • join
  • lower
  • upper
  • capitalize
  • length
  • without
  • time
  • strip_tags
  • json_encode
  • json_decode
  • last
  • date
  • replace
  • timestamp
  • split
  • url_encode
  • merge
  • camel
  • t
  • camelToHypens

*Some of these are dummy filters that don't do anything except keep Twig.js compilation from breaking when these specific functions are used in Twig templates.

Dependents (0)

Package Sidebar

Install

npm i twig-craft-cms-filters

Weekly Downloads

2

Version

2.5.0

License

MIT

Unpacked Size

11.8 kB

Total Files

25

Last publish

Collaborators

  • dianyela-maldonado