Commit 5ca81b04 authored by Fabien Potencier's avatar Fabien Potencier

fixed doc

parent d89cbcd9
...@@ -12,11 +12,11 @@ Changelog ...@@ -12,11 +12,11 @@ Changelog
After:: After::
$app['twig'] = $app->extend('twig', function($twig, $app) { $app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
// do something // do something
return $twig; return $twig;
}); }));
* **2012-06-13**: Added a route ``before`` middleware * **2012-06-13**: Added a route ``before`` middleware
......
...@@ -126,12 +126,12 @@ Customization ...@@ -126,12 +126,12 @@ Customization
You can configure the Twig environment before using it by extending the You can configure the Twig environment before using it by extending the
``twig`` service:: ``twig`` service::
$app['twig'] = $app->extend('twig', function($twig, $app) { $app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
$twig->addGlobal('pi', 3.14); $twig->addGlobal('pi', 3.14);
$twig->addFilter('levenshtein', new \Twig_Filter_Function('levenshtein')); $twig->addFilter('levenshtein', new \Twig_Filter_Function('levenshtein'));
return $twig; return $twig;
}); }));
For more information, check out the `Twig documentation For more information, check out the `Twig documentation
<http://twig.sensiolabs.org>`_. <http://twig.sensiolabs.org>`_.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment