Commit 8cb3a0a3 authored by Igor Wiedler's avatar Igor Wiedler

[docs] remove extension use statements from extensions.rst

parent 5a08609d
...@@ -10,18 +10,16 @@ Loading extensions ...@@ -10,18 +10,16 @@ Loading extensions
In order to load and use an extension, you must register it In order to load and use an extension, you must register it
on the application. :: on the application. ::
use Acme\DatabaseExtension; $app = new Silex\Application();
$app = new Application(); $app->register(new Acme\DatabaseExtension());
$app->register(new DatabaseExtension());
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 extension is registered. will be set **before** the extension is registered.
:: ::
$app->register(new DatabaseExtension(), array( $app->register(new Acme\DatabaseExtension(), 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',
...@@ -110,11 +108,9 @@ is also missing, it will use an empty string. ...@@ -110,11 +108,9 @@ is also missing, it will use an empty string.
You can now use this extension as follows:: You can now use this extension as follows::
use Acme\HelloExtension; $app = new Silex\Application();
$app = new Application();
$app->register(new HelloExtension(), array( $app->register(new Acme\HelloExtension(), array(
'hello.default_name' => 'Igor', 'hello.default_name' => 'Igor',
)); ));
......
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