Organize and show value types

This commit is contained in:
Kevin Simper
2015-02-04 15:44:30 +01:00
committed by Fabien Potencier
parent 69984ee652
commit 0a46d06069
+25 -9
View File
@@ -72,29 +72,43 @@ options as the constructor second argument::
The following options are available: The following options are available:
* ``debug``: When set to ``true``, the generated templates have a * ``debug`` *boolean*
When set to ``true``, the generated templates have a
``__toString()`` method that you can use to display the generated nodes ``__toString()`` method that you can use to display the generated nodes
(default to ``false``). (default to ``false``).
* ``charset``: The charset used by the templates (default to ``utf-8``). * ``charset`` *string (default to ``utf-8``)*
* ``base_template_class``: The base template class to use for generated The charset used by the templates.
templates (default to ``Twig_Template``).
* ``cache``: An absolute path where to store the compiled templates, or * ``base_template_class`` *(default to ``Twig_Template``)*
The base template class to use for generated
templates.
* ``cache`` *boolean*
An absolute path where to store the compiled templates, or
``false`` to disable caching (which is the default). ``false`` to disable caching (which is the default).
* ``auto_reload``: When developing with Twig, it's useful to recompile the * ``auto_reload`` *boolean*
When developing with Twig, it's useful to recompile the
template whenever the source code changes. If you don't provide a value for 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 the ``auto_reload`` option, it will be determined automatically based on the
``debug`` value. ``debug`` value.
* ``strict_variables``: If set to ``false``, Twig will silently ignore invalid * ``strict_variables`` *boolean*
If set to ``false``, Twig will silently ignore invalid
variables (variables and or attributes/methods that do not exist) and variables (variables and or attributes/methods that do not exist) and
replace them with a ``null`` value. When set to ``true``, Twig throws an replace them with a ``null`` value. When set to ``true``, Twig throws an
exception instead (default to ``false``). exception instead (default to ``false``).
* ``autoescape``: If set to ``true``, HTML auto-escaping will be enabled by * ``autoescape`` *boolean*
If set to ``true``, HTML auto-escaping will be enabled by
default for all templates (default to ``true``). default for all templates (default to ``true``).
As of Twig 1.8, you can set the escaping strategy to use (``html``, ``js``, As of Twig 1.8, you can set the escaping strategy to use (``html``, ``js``,
@@ -110,7 +124,9 @@ The following options are available:
strategy does not incur any overhead at runtime as auto-escaping is done at strategy does not incur any overhead at runtime as auto-escaping is done at
compilation time.) compilation time.)
* ``optimizations``: A flag that indicates which optimizations to apply * ``optimizations`` *integer*
A flag that indicates which optimizations to apply
(default to ``-1`` -- all optimizations are enabled; set it to ``0`` to (default to ``-1`` -- all optimizations are enabled; set it to ``0`` to
disable). disable).