From: Fabien Potencier Date: Fri, 31 Dec 2010 14:39:12 +0000 (+0100) Subject: removed old recipe from the doc as macros do not output their content directly anymore X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=11de78daa3c24d0a68105fc1a8246da58a0bae4f;p=web%2Fkonrad%2Ftwig.git removed old recipe from the doc as macros do not output their content directly anymore --- diff --git a/doc/recipes.rst b/doc/recipes.rst index 2099fe0..a615507 100644 --- a/doc/recipes.rst +++ b/doc/recipes.rst @@ -208,22 +208,3 @@ The output will be similar to: In the inner loop, the ``loop.parent`` variable is used to access the outer context. So, the index of the current ``topic`` defined in the outer for loop is accessible via the ``loop.parent.loop.index`` variable. - -Passing a Macro as an Argument ------------------------------- - -(new in Twig 0.9.6) - -By default, a macro directly outputs its content to the screen. If you want to -pass the content of a macro as an argument to a method or to another macro, -you can use the ``set`` tag: - -.. code-block:: jinja - - {% import "form_elements.html" as form %} - - {% set theinput %} - {{ form.input('test', 'text', 'Value') }} - {% endset %} - - {{ form.row('Label', theinput) }}