Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[docs] enhance extend docs

  • Loading branch information...
commit 8e0f1bd3e8c10f47c40613a8869067412d6e4d24 1 parent 6213e14
Igor Wiedler authored April 01, 2012

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  README.rst
8  README.rst
Source Rendered
@@ -84,15 +84,19 @@ can use the ``extend()`` method to do just that::
84 84
         return new Twig_Environment($c['twig.loader'], $c['twig.options']);
85 85
     });
86 86
 
87  
-    $c['twig'] = $c->extend(function ($twig, $c) {
  87
+    $c['twig'] = $c->extend('twig', function ($twig, $c) {
88 88
         $twig->addExtension(new MyTwigExtension());
89 89
         return $twig;
90 90
     });
91 91
 
  92
+The first argument is the name of the object, the second is a function that
  93
+gets access to the object instance and the container. The return value is
  94
+a service definition, so you need to re-assign it on the container.
  95
+
92 96
 Fetching the Object creation function
93 97
 -------------------------------------
94 98
 
95  
-When you access an Object, Pimple automatically calls the function that you
  99
+When you access an object, Pimple automatically calls the function that you
96 100
 defined, which creates the Object for you. If you want to get this function,
97 101
 you can use the ``raw()`` method::
98 102
 

0 notes on commit 8e0f1bd

Please sign in to comment.
Something went wrong with that request. Please try again.