Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
694fe555
Commit
694fe555
authored
May 14, 2017
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaked an example
parent
c7a108a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
doc/services.rst
doc/services.rst
+6
-1
No files found.
doc/services.rst
View file @
694fe555
...
@@ -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
-------------
-------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment