[TwigSettings]
Available since Exponential 6.0.15 (in development, not in a release yet).
Summary
The group [TwigSettings] of settings/twig.ini.
File
settings/twig.ini; override it in settings/override/twig.ini.append.php, in a siteaccess or in an extension.
Settings
| Setting | Default | Description |
|---|---|---|
| LibraryPath | (empty) | Where Twig 3 is loaded from when the installation's Composer autoload has no twig/twig: a directory with vendor/autoload.php (a Composer directory that requires twig/twig), or the twig/twig package itself (the directory holding src/Environment.php). Relative to the installation root, or absolute. |
| AutoReload | enabled | Twig's auto_reload: a changed .twig is compiled again. disabled saves a file check per template on production systems (clear the template caches after a deploy). |
| Debug | disabled | Twig's debug mode (the dump() function, debug information in compiled code). |
| StrictVariables | disabled | disabled: an undefined variable or attribute prints nothing, as in a .tpl. |
| Autoescape | disabled | disabled: nothing is escaped unless the template says so (|wash), as in a .tpl, so converted templates print what the .tpl printed. A siteaccess may enable it (html) for hand-written templates; see the security guide. |
| TemplateSuffixList[] | .twig; .html.twig | Template file endings Twig renders (expTemplateEngines matches the longest first). The same list as site.ini [TemplateBridgeSettings] EngineSuffixList[]. |
| WhileLoopLimit | 10000 | The most rounds a converted {while} or {do} loop runs ({% expwhile %}); a loop that reaches it stops with a debug notice. |
| FunctionList[] | attribute_view_gui; attribute_edit_gui; attribute_result_gui; attribute_pdf_gui; node_view_gui; content_view_gui; content_version_view_gui; class_attribute_view_gui; class_attribute_edit_gui; related_view_gui; shop_account_view_gui | Template functions callable as Twig functions with a hash of named parameters, {{ attribute_view_gui({attribute: a}) }}. Every other template function without children is bridged too; functions with children become tags ({% explblock name='x' %}...{% endexplblock %}). |
| ParameterOperatorList[] | (empty array) | Operators without template hints that read their parameters only, never their input (in addition to site.ini [TemplateBridgeSettings] ParameterOperatorList[], the list for every engine). |
| Profile | disabled | enabled (and debug output on): the debug bar's accumulators show where a page's Twig time goes (renders, compiled-template loads, operators, template functions, includes, wrapping). |
| Security | enabled | The sandbox (Twig's SandboxExtension with the policy of expTwigSecurity). enabled: a template may only use the tags, filters and functions allowed here; no method of an object can be called and no property read (values of the template system are read through their attributes, which is allowed). Compiled apart from the templates compiled without it (<cache>/twig/compile-secure). |
| SecurityAllowedTagList[] | if; for; set; apply; block; extends; include; embed; macro; import; from; use; with; verbatim; guard; types | Tags allowed (empty: Twig's own tags below, and every exp* tag of lib/twig). |
| SecurityAllowedFilterList[] | abs; batch; capitalize; column; date; default; e; escape; first; format; join; json_encode; keys; last; length; lower; merge; nl2br; number_format; raw; replace; reverse; round; slice; sort; split; striptags; title; trim; upper; url_encode | Twig filters allowed in addition to every bridged operator. |
| SecurityAllowedFunctionList[] | attribute; block; cycle; max; min; parent; random; range | Twig functions allowed in addition to every bridged operator and template function. |
| SecurityAllowedMethodList[] | (empty array) | Methods allowed as Class::method (none by default: values are read through attributes). |
| SecurityAllowedPropertyList[] | (empty array) | Properties allowed as Class::property (none by default). |
See also
Generated example: twig.ini [TwigSettings]
Added to the reference for Exponential 6.0.15: the 4.x reference had no page for this group. The descriptions are the comment lines of settings/twig.ini.
Contributors
- Graham Brookins Updated
Comments
Add a comment