Releases: fvsch/kirby-twig
2.0 – Renamed options, fewer limitations
Renamed options
All options in 2.0 were renamed from plugin.twig.something
to twig.something
, which is more usual for Kirby plugins. Note that in order to enable the plugin, the plugin.twig.enabled
option was renamed to just twig
, so that you can enable the plugin with:
c::set('twig', true);
Fewer limitations
The list of Kirby helper functions passed to Twig templates was revised to include almost all helper functions (instead of an arbitrary selection). There are also two options for passing more functions and even PHP classes to templates:
c::set('twig.env.functions', ['myFunction', 'str::endsWith']);
c::set('twig.env.classes', ['cookie', 'SomeClass']);
And classes can be used in Twig as {{ new('SomeClass', 'other', 'param').someMethod() }}
.
While this is nice and sweet and can help in a pinch, note that most of the time you should use controllers instead, and pass your objects to the templates.
1.3 – Now with simpler install
Can now be installed more easily, without Composer.
Feature-complete with error page
Somewhere along the way I skipped the 1.1 number, sorry.
First somewhat stable release
v1.0.0 Check class instead of version & check if Twig is already loaded