Twig templating support for Kirby CMS 2. For Kirby 3, use https://github.com/amteich/kirby-twig
Remove most doc files (except the LICENSE) on the Composer branch, so that Composer only downloads what is useful.
Fixes:
twig()
helper function allows rendering a template file or a template string from PHP.twig.function.*
config keys that allow exposing any number of functions to Twig templates from config, plugins, etc.Kirby\Twig\Plugin
class which will act as a stable API, while other implementation details may change.twig.env.classes
option and new()
Twig function.c::set('twig.cache', true);
).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.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
.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.If you’re arriving here from the Kirby Cosmos newsletter, note that Kirby Twig 3.0.0 stable was realeased.
Installation instructions: https://github.com/fvsch/kirby-twig#installation
Release notes: https://github.com/fvsch/kirby-twig/releases/tag/v3.0.0
pattern()
helper function (from the Kirby Patterns plugin) to the list of functions available by default.c()
function was renamed to c__get()
This re-enables installing with Composer, this time directly from Packagist, but it does not (yet?) replace the Twig library copy with a Composer-installed one.
Warning: error page was not showing in 2.0.0. Fixed in this release.