mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 20:06:31 +00:00
[Doc] Updated template_from_string to use include function
instead of include tag
This commit is contained in:
@@ -8,8 +8,8 @@ The ``template_from_string`` function loads a template from a string:
|
|||||||
|
|
||||||
.. code-block:: jinja
|
.. code-block:: jinja
|
||||||
|
|
||||||
{% include template_from_string("Hello {{ name }}") %}
|
{{ include(template_from_string("Hello {{ name }}") }}
|
||||||
{% include template_from_string(page.template) %}
|
{{ include(template_from_string(page.template)) }}
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ The ``template_from_string`` function loads a template from a string:
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Even if you will probably always use the ``template_from_string`` function
|
Even if you will probably always use the ``template_from_string`` function
|
||||||
with the ``include`` tag, you can use it with any tag or function that
|
with the ``include`` function, you can use it with any tag or function that
|
||||||
takes a template as an argument (like the ``embed`` or ``extends`` tags).
|
takes a template as an argument (like the ``embed`` or ``extends`` tags).
|
||||||
|
|
||||||
Arguments
|
Arguments
|
||||||
|
|||||||
Reference in New Issue
Block a user