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
8cb3a0a3
Commit
8cb3a0a3
authored
May 05, 2011
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[docs] remove extension use statements from extensions.rst
parent
5a08609d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
doc/extensions.rst
doc/extensions.rst
+5
-9
No files found.
doc/extensions.rst
View file @
8cb3a0a3
...
...
@@ -10,18 +10,16 @@ Loading extensions
In order to load and use an extension, you must register it
on the application. ::
use Acme\DatabaseExtension
;
$app = new Silex\Application()
;
$app = new Application();
$app->register(new DatabaseExtension());
$app->register(new Acme\DatabaseExtension());
You can also provide some parameters as a second argument. These
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.user' => 'root',
'database.password' => 'secret_root_password',
...
...
@@ -110,11 +108,9 @@ is also missing, it will use an empty string.
You can now use this extension as follows::
use Acme\HelloExtension;
$app = new Application();
$app = new Silex\Application();
$app->register(new HelloExtension(), array(
$app->register(new
Acme\
HelloExtension(), array(
'hello.default_name' => 'Igor',
));
...
...
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