@@ -13,9 +13,21 @@ c::set('twig.usephp', true);
1313// For instance 'error/system'. Falls back to c::get('error').
1414c::set('twig.error', '');
1515
16+ // List of additional functions that should be available in templates
17+ c::set('twig.env.functions', ['myCustomFunction']);
18+
19+ // List of classes that can be instantiated from templates (with the `new()` function)
20+ c::set('twig.env.classes', ['SomeClass']);
21+ ```
22+
23+ ## Advanced
24+
25+ ```
1626// Use Twig’s PHP cache?
17- // (Note that Kirby has its own HTML cache.)
18- c::set('twig.cache', false);
27+ // Enabled by default. Note that Kirby has its own HTML cache for pages,
28+ // so this might be extra work, but for pages which are often not cached
29+ // (e.g. search pages with a specific query string) this could be useful.
30+ c::set('twig.cache', true);
1931
2032// Disable autoescaping or specify autoescaping type
2133// http://twig.sensiolabs.org/doc/api.html#environment-options
@@ -24,10 +36,4 @@ c::set('twig.autoescape', true);
2436// Should Twig throw errors when using undefined variables or methods?
2537// Defaults to the value of the 'debug' option
2638c::set('twig.strict', c::get('debug', false));
27-
28- // List of additional functions that should be available in templates
29- c::set('twig.env.functions', ['myCustomFunction']);
30-
31- // List of classes that can be instantiated from templates (with the `new()` function)
32- c::set('twig.env.classes', ['SomeClass']);
3339```
0 commit comments