This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
3.0.0 – twig helper & more
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 andnew()
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 iserror
by default) will be used in some specific situations. Seedoc/errors.md
for details.
Deprecated (still working)
twig.env.functions
in favor oftwig.function.myFunction
;twig.env.filters
in favor oftwig.filter.myFilter
;twig.env.namespace.xyz
in favor oftwig.namespace.xyz
.
Note on branches and tags
develop
is now the development branch, with new features and potentially breaking changes.composer
is the stable release that can be installed with Composer; Git tags starting from v3 will all point to this branch.master
is the stable release that can be installed by downloading a zip file or with Kirby’s CLI.