* An absolute path where to store the compiled templates.
* `auto_reload`: When developing with Twig, it's useful to recompile the
- template whenever the source code changes. This is the default behavior for
- `Twig_Loader_Filesystem` for instance. In a production environment, you can
- set this option to `false` for better performance. If you don't provide the
- `auto_reload` option, it will be determined automatically base on the
+ template whenever the source code changes. If you don't provide a value for
+ the `auto_reload` option, it will be determined automatically based on the
`debug` value.
>**CAUTION**
{% var|escape %} {# var won't be doubled-escaped #}
{% endautoescape %}
-The escaping rules are implemented as follows:
+The escaping rules are implemented as follows (it describes the behavior of
+Twig 0.9.5 and above):
* Literals (integers, booleans, arrays, ...) used in the template directly as
variables or filter arguments are never automatically escaped:
just a regular PHP function or method that takes the left side of the filter
as first argument and the arguments passed to the filter as extra arguments.
+>**CAUTION**
+>This section describes the creation of new filters for Twig 0.9.5 and above.
+
### Function Filters
Let's create a filter, named `rot13`, which returns the
Overriding default Filters
--------------------------
+>**CAUTION**
+>This section describes how to override default filters for Twig 0.9.5 and
+>above.
+
If some default core filters do not suit your needs, you can easily override
them by creating your own core extension. Of course, you don't need to copy
and paste the whole core extension code of Twig. Instead, you can just extends