Commit 694fe555 authored by Fabien Potencier's avatar Fabien Potencier

tweaked an example

parent c7a108a1
...@@ -159,7 +159,12 @@ using the ``protect`` method:: ...@@ -159,7 +159,12 @@ using the ``protect`` method::
// calling it now // calling it now
echo $add(2, 3); echo $add(2, 3);
Note that the container is not provided as an argument to protected closures (but you can access it via `use($app)`). Note that the container is not provided as an argument to protected closures.
However, you can inject it via `use($app)`::
$app['closure_parameter'] = $app->protect(function ($a, $b) use ($app) {
// ...
});
Core services Core services
------------- -------------
......
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