Merge branch '1.x' into 2.x

* 1.x:
  Update .travis.yml
  fiwed internal link
  Make sure twig_include returns a string
This commit is contained in:
Fabien Potencier
2018-11-30 07:25:29 +01:00
4 changed files with 8 additions and 6 deletions
+1
View File
@@ -12,6 +12,7 @@ matrix:
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: nightly
fast_finish: true
+3 -4
View File
@@ -14,11 +14,10 @@ The ``json_encode`` filter returns the JSON representation of a value:
Arguments
---------
* ``options``: A bitmask of `json_encode options`_ (``{{
* ``options``: A bitmask of `json_encode options`_: ``{{
data|json_encode(constant('JSON_PRETTY_PRINT')) }}``.
Combine constants using `Twig's bitwise operators`: ``{{
data|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_HEX_QUOT') }}``)
Combine constants using :ref:`bitwise operators<template_logic>`:
``{{ data|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_HEX_QUOT') }}``
.. _`json_encode`: https://secure.php.net/json_encode
.. _`json_encode options`: https://secure.php.net/manual/en/json.constants.php
.. _`Twig's bitwise operators`: https://twig.symfony.com/doc/2.x/templates.html#logic
+3 -1
View File
@@ -651,6 +651,8 @@ but exists for completeness' sake. The following operators are supported:
* ``**``: Raises the left operand to the power of the right operand. ``{{ 2 **
3 }}`` would return ``8``.
.. _template_logic:
Logic
~~~~~
@@ -666,7 +668,7 @@ You can combine multiple expressions with the following operators:
.. note::
Twig also support bitwise operators (``b-and``, ``b-xor``, and ``b-or``).
Twig also supports bitwise operators (``b-and``, ``b-xor``, and ``b-or``).
.. note::
+1 -1
View File
@@ -1310,7 +1310,7 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = a
}
}
$result = null;
$result = '';
try {
$result = $env->resolveTemplate($template)->render($variables);
} catch (Twig_Error_Loader $e) {