Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

3.0.0 – twig helper & more

Compare
Choose a tag to compare
@fvsch fvsch released this 19 Jan 09:32
· 8 commits to composer since this release

New features

  • A new twig() helper function allows rendering a template file or a template string from PHP.
  • Flexible configuration with twig.function.* config keys that allow exposing any number of functions to Twig templates from config, plugins, etc.
  • Improved error handling.
  • Much of the documentation has been rewritten.

BREAKING

  • Namespace and class names (and sometimes methods) have changed; there is now a Kirby\Twig\Plugin class which will act as a stable API, while other implementation details may change.
  • Removed the twig.env.classes option and new() Twig function.
  • Twig’s template cache is now disabled by default (enable with c::set('twig.cache', true);).
  • Error reporting: the twig.error config key is now ignored. Instead, the site’s main error page (whose URI is error by default) will be used in some specific situations. See doc/errors.md for details.

Deprecated (still working)

  • twig.env.functions in favor of twig.function.myFunction;
  • twig.env.filters in favor of twig.filter.myFilter;
  • twig.env.namespace.xyz in favor of twig.namespace.xyz.

Note on branches and tags

  1. develop is now the development branch, with new features and potentially breaking changes.
  2. composer is the stable release that can be installed with Composer; Git tags starting from v3 will all point to this branch.
  3. master is the stable release that can be installed by downloading a zip file or with Kirby’s CLI.