From 3259798db6756351fc575669abcf67712acc7a38 Mon Sep 17 00:00:00 2001 From: fabien Date: Tue, 15 Dec 2009 07:34:06 +0000 Subject: [PATCH] added some warnings when a section describes Twig 0.9.5 git-svn-id: http://svn.twig-project.org/trunk@188 93ef8e89-cb99-4229-a87c-7fa0fa45744b --- doc/03-Twig-for-Developers.markdown | 9 ++++----- doc/04-Extending-Twig.markdown | 7 +++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/03-Twig-for-Developers.markdown b/doc/03-Twig-for-Developers.markdown index 1a9a0da..cca6350 100644 --- a/doc/03-Twig-for-Developers.markdown +++ b/doc/03-Twig-for-Developers.markdown @@ -97,10 +97,8 @@ The following options are available: * 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** @@ -311,7 +309,8 @@ You can also change the escaping mode locally by using the `autoescape` tag: {% 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: diff --git a/doc/04-Extending-Twig.markdown b/doc/04-Extending-Twig.markdown index ca6a1cc..2093b9f 100644 --- a/doc/04-Extending-Twig.markdown +++ b/doc/04-Extending-Twig.markdown @@ -75,6 +75,9 @@ The most common element you will want to add to Twig is filters. A filter is 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 @@ -223,6 +226,10 @@ raw variable value. In such a case, set the `is_escaper` option to `true`: 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 -- 1.7.2.5