Implementation Notes

Виктор Виктор edited this page Jul 5, 2018 · 23 revisions

Differences / Implementation Notes

  • currently twig.js does not have the same auto-escaping that Twig does.

Feature Support

Built-in Tags:

  • autoescape:
  • block: Supported
  • do:
  • embed: Supported
  • extends: Supported
  • filter: Supported
  • flush: N/A
  • for: Supported
  • from: Supported
  • if: Supported
  • import: Supported
  • include: Supported
  • macro: Supported
  • sandbox:
  • set: Supported
  • spaceless: Supported
  • use: Supported
  • verbatim: Supported
  • with: Supported

Filters

  • abs: Supported
  • batch: Supported
  • capitalize: Supported
  • convert_encoding: N/A
  • date: Supported
  • date_modify: Supported
  • default: Supported
  • escape: Supported
  • first: Supported
  • format: Supported
  • join: Supported
  • json_encode: Supported
  • keys: Supported
  • last: Supported
  • length: Supported
  • lower: Supported
  • merge: Supported
  • nl2br: Supported
  • number_format: Supported
  • raw:
  • replace: Supported
  • reverse: Supported
  • round: Supported
  • slice: Supported
  • sort: Supported
  • split: Supported
  • striptags: Supported
  • title: Supported
  • trim: Supported
  • upper: Supported
  • url_encode: Supported

Built-in Tests:

  • constant:
  • defined: Supported
  • divisibleby: Supported
  • empty: Supported
  • even: Supported
  • iterable: Supported
  • null / none: Supported
  • odd: Supported
  • sameas: Supported

Built-in Operators:

  • in: Supported
  • is: Supported
  • Math (+, -, /, %, *, **): Supported
  • Logic (and, or, not, ()): Supported
  • Bitwise (b-and, b-or, b-xor): Supported
  • Comparisons (==, !=, <, >, >=, <=, ===): Supported
  • Others (.., |, ~, ., [], ?:): Supported
  • Null-coalescing (??): Issue #319 open
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.