From 6e2d7ba1b90771e68b78b5ab89142141b6bb7deb Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 7 Dec 2011 11:01:05 +0100 Subject: [PATCH] added documentation for the new string interpolation feature --- CHANGELOG | 1 + doc/templates.rst | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9d58718..60839c2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ * 1.5.0 + * added string interpolation support * enhanced exceptions for unknown filters, functions, tests, and tags * 1.4.0 (2011-12-07) diff --git a/doc/templates.rst b/doc/templates.rst index a955df2..6a3b871 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -614,6 +614,21 @@ categories: * ``?:``: The PHP ternary operator: ``{{ foo ? 'yes' : 'no' }}`` +String Interpolation +~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 1.5 + String interpolation was added in Twig 1.5. + +String interpolation (`#{expression}`) allows any valid expression to appear +within a string. The result of evaluating that expression is inserted into the +string: + +.. code-block:: jinja + + {{ "foo #{bar} baz" }} + {{ "foo #{1 + 2} baz" }} + Whitespace Control ------------------ -- 1.7.2.5