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
124654fc
Commit
124654fc
authored
Jun 03, 2016
by
Harm van Tilborg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some typo fixes
parent
7d1e96c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
doc/services.rst
doc/services.rst
+3
-3
No files found.
doc/services.rst
View file @
124654fc
...
...
@@ -165,18 +165,18 @@ Modify services after definition
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sometimes you want to alter a service after its definition. Pimple facilitates
this by
``extend``-
ing the already defined service.
this by
extend
ing the already defined service.
First argument of the ``extend`` method is the name of the service you want to
modify. Second argument is a callable. This callable is executed with the service
you want to alter as its first argument, the service container self is provided
you want to alter as its first argument, the service container
it
self is provided
in the second argument.
.. note::
Be sure to return the modified service in the callable.
You can use this pattern to add functionality to :doc:
Twi
g <providers/twig> for
You can use this pattern to add functionality to :doc:
Monolo
g <providers/twig> for
example::
$app->extend('twig', function($twig, $app) {
...
...
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