Merge branch '1.x'

* 1.x:
  Small fixes
  Grammar
  [DOC] recipes.rst uses Twig_Function_Function
  handle Throwable
This commit is contained in:
Fabien Potencier
2016-05-30 11:07:11 +02:00
4 changed files with 12 additions and 6 deletions
+3 -3
View File
@@ -19,11 +19,11 @@ The key-features are...
may modify the template design.
* *Flexible*: Twig is powered by a flexible lexer and parser. This allows the
developer to define its own custom tags and filters, and create its own DSL.
developer to define their own custom tags and filters, and to create their own DSL.
Twig is used by many Open-Source projects like Symfony, Drupal8, eZPublish,
phpBB, Piwik, OroCRM, and many frameworks have support for it as well like
Slim, Yii, Laravel, Codeigniter, and Kohana, just to name a few.
phpBB, Piwik, OroCRM; and many frameworks have support for it as well like
Slim, Yii, Laravel, Codeigniter and Kohana just to name a few.
Prerequisites
-------------
+1 -1
View File
@@ -277,7 +277,7 @@ For functions, use ``registerUndefinedFunctionCallback()``::
// don't try this at home as it's not secure at all!
$twig->registerUndefinedFunctionCallback(function ($name) {
if (function_exists($name)) {
return new Twig_Function_Function($name);
return new Twig_SimpleFunction($name, $name);
}
return false;
+2 -2
View File
@@ -131,8 +131,8 @@ to variables from outer scopes:
Block Shortcuts
---------------
For blocks with few content, it's possible to use a shortcut syntax. The
following constructs do the same:
For blocks with little content, it's possible to use a shortcut syntax. The
following constructs do the same thing:
.. code-block:: jinja
+6
View File
@@ -359,6 +359,12 @@ abstract class Twig_Template
ob_end_clean();
}
throw $e;
} catch (Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}