mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
Merge branch '1.x'
* 1.x: Small fixes Grammar [DOC] recipes.rst uses Twig_Function_Function handle Throwable
This commit is contained in:
+3
-3
@@ -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
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user