Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed doc on service providers

  • Loading branch information...
commit 0731e0c984d6b807701ca097201044e4ccda85c7 1 parent 27979a2
Fabien Potencier authored May 30, 2012

Showing 1 changed file with 11 additions and 3 deletions. Show diff stats Hide diff stats

  1. 14  doc/providers.rst
14  doc/providers.rst
Source Rendered
@@ -77,11 +77,15 @@ Providers must implement the ``Silex\ServiceProviderInterface``::
77 77
     interface ServiceProviderInterface
78 78
     {
79 79
         function register(Application $app);
  80
+
  81
+        function boot(Application $app);
80 82
     }
81 83
 
82  
-This is very straight forward, just create a new class that implements the
83  
-``register`` method. In this method you must define services on the
84  
-application which then may make use of other services and parameters.
  84
+This is very straight forward, just create a new class that implements the two
  85
+methods. In the ``register()`` method, you can define services on the
  86
+application which then may make use of other services and parameters. In the
  87
+``boot()`` method, you can configure the application, just before it handles a
  88
+request.
85 89
 
86 90
 Here is an example of such a provider::
87 91
 
@@ -101,6 +105,10 @@ Here is an example of such a provider::
101 105
                 return 'Hello '.$app->escape($name);
102 106
             });
103 107
         }
  108
+
  109
+        public function boot(Application $app)
  110
+        {
  111
+        }
104 112
     }
105 113
 
106 114
 This class provides a ``hello`` service which is a protected closure. It takes

0 notes on commit 0731e0c

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