Commit 4d69d075 authored by Fabien Potencier's avatar Fabien Potencier

fixed some class names in the doc

parent 41639536
...@@ -17,12 +17,12 @@ application:: ...@@ -17,12 +17,12 @@ application::
$app = new Silex\Application(); $app = new Silex\Application();
$app->register(new Acme\DatabaseProvider()); $app->register(new Acme\DatabaseServiceProvider());
You can also provide some parameters as a second argument. These You can also provide some parameters as a second argument. These
will be set **before** the provider is registered:: will be set **before** the provider is registered::
$app->register(new Acme\DatabaseProvider(), array( $app->register(new Acme\DatabaseServiceProvider(), array(
'database.dsn' => 'mysql:host=localhost;dbname=myapp', 'database.dsn' => 'mysql:host=localhost;dbname=myapp',
'database.user' => 'root', 'database.user' => 'root',
'database.password' => 'secret_root_password', 'database.password' => 'secret_root_password',
...@@ -61,16 +61,16 @@ Included providers ...@@ -61,16 +61,16 @@ Included providers
There are a few provider that you get out of the box. There are a few provider that you get out of the box.
All of these are within the ``Silex\Provider`` namespace. All of these are within the ``Silex\Provider`` namespace.
* :doc:`DoctrineProvider <providers/doctrine>` * :doc:`DoctrineServiceProvider <providers/doctrine>`
* :doc:`MonologProvider <providers/monolog>` * :doc:`MonologServiceProvider <providers/monolog>`
* :doc:`SessionProvider <providers/session>` * :doc:`SessionServiceProvider <providers/session>`
* :doc:`SwiftmailerServiceProvider <providers/swiftmailer>` * :doc:`SwiftmailerServiceProvider <providers/swiftmailer>`
* :doc:`SymfonyBridgesServiceProvider <providers/symfony_bridges>` * :doc:`SymfonyBridgesServiceProvider <providers/symfony_bridges>`
* :doc:`TwigProvider <providers/twig>` * :doc:`TwigServiceProvider <providers/twig>`
* :doc:`TranslationProvider <providers/translation>` * :doc:`TranslationServiceProvider <providers/translation>`
* :doc:`UrlGeneratorProvider <providers/url_generator>` * :doc:`UrlGeneratorServiceProvider <providers/url_generator>`
* :doc:`ValidatorProvider <providers/validator>` * :doc:`ValidatorServiceProvider <providers/validator>`
* :doc:`HttpCacheProvider <providers/http_cache>` * :doc:`HttpCacheServiceProvider <providers/http_cache>`
Creating a provider Creating a provider
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
...@@ -94,7 +94,7 @@ Here is an example of such a provider:: ...@@ -94,7 +94,7 @@ Here is an example of such a provider::
use Silex\Application; use Silex\Application;
use Silex\ServiceProviderInterface; use Silex\ServiceProviderInterface;
class HelloProvider implements ServiceProviderInterface class HelloServiceProvider implements ServiceProviderInterface
{ {
public function register(Application $app) public function register(Application $app)
{ {
...@@ -116,7 +116,7 @@ You can now use this provider as follows:: ...@@ -116,7 +116,7 @@ You can now use this provider as follows::
$app = new Silex\Application(); $app = new Silex\Application();
$app->register(new Acme\HelloProvider(), array( $app->register(new Acme\HelloServiceProvider(), array(
'hello.default_name' => 'Igor', 'hello.default_name' => 'Igor',
)); ));
...@@ -133,8 +133,8 @@ Class loading ...@@ -133,8 +133,8 @@ Class loading
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Providers are great for tying in external libraries as you Providers are great for tying in external libraries as you
can see by looking at the ``MonologProvider`` and can see by looking at the ``MonologServiceProvider`` and
``TwigProvider``. If the library is decent and follows the ``TwigServiceProvider``. If the library is decent and follows the
`PSR-0 Naming Standard <http://groups.google.com/group/php-standards/web/psr-0-final-proposal>`_ `PSR-0 Naming Standard <http://groups.google.com/group/php-standards/web/psr-0-final-proposal>`_
or the PEAR Naming Convention, it is possible to autoload or the PEAR Naming Convention, it is possible to autoload
classes using the ``UniversalClassLoader``. classes using the ``UniversalClassLoader``.
...@@ -149,7 +149,7 @@ Here is an example of how to use it (based on `Buzz <https://github.com/kriswall ...@@ -149,7 +149,7 @@ Here is an example of how to use it (based on `Buzz <https://github.com/kriswall
use Silex\Application; use Silex\Application;
use Silex\ServiceProviderInterface; use Silex\ServiceProviderInterface;
class BuzzProvider implements ServiceProviderInterface class BuzzServiceProvider implements ServiceProviderInterface
{ {
public function register(Application $app) public function register(Application $app)
{ {
...@@ -164,7 +164,7 @@ Here is an example of how to use it (based on `Buzz <https://github.com/kriswall ...@@ -164,7 +164,7 @@ Here is an example of how to use it (based on `Buzz <https://github.com/kriswall
This allows you to simply provide the class path as an This allows you to simply provide the class path as an
option when registering the provider:: option when registering the provider::
$app->register(new BuzzProvider(), array( $app->register(new BuzzServiceProvider(), array(
'buzz.class_path' => __DIR__.'/vendor/buzz/lib', 'buzz.class_path' => __DIR__.'/vendor/buzz/lib',
)); ));
...@@ -185,7 +185,7 @@ controllers under a path:: ...@@ -185,7 +185,7 @@ controllers under a path::
$app = new Silex\Application(); $app = new Silex\Application();
$app->mount('/blog', new Acme\BlogProvider()); $app->mount('/blog', new Acme\BlogControllerProvider());
All controllers defined by the provider will now be available under the All controllers defined by the provider will now be available under the
`/blog` path. `/blog` path.
...@@ -207,7 +207,7 @@ Here is an example of such a provider:: ...@@ -207,7 +207,7 @@ Here is an example of such a provider::
use Silex\Application; use Silex\Application;
use Silex\ControllerProviderInterface; use Silex\ControllerProviderInterface;
class HelloProvider implements ControllerProviderInterface class HelloControllerProvider implements ControllerProviderInterface
{ {
public function connect(Application $app) public function connect(Application $app)
{ {
...@@ -233,7 +233,7 @@ You can now use this provider as follows:: ...@@ -233,7 +233,7 @@ You can now use this provider as follows::
$app = new Silex\Application(); $app = new Silex\Application();
$app->connect('/blog', new Acme\HelloProvider()); $app->connect('/blog', new Acme\HelloControllerProvider());
In this example, the ``/blog/`` path now references the controller defined in In this example, the ``/blog/`` path now references the controller defined in
the provider. the provider.
......
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