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
c6747411
Commit
c6747411
authored
Mar 26, 2011
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added an extension system
parent
8a7b4321
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
src/Silex/Application.php
src/Silex/Application.php
+9
-0
src/Silex/ExtensionInterface.php
src/Silex/ExtensionInterface.php
+17
-0
No files found.
src/Silex/Application.php
View file @
c6747411
...
...
@@ -68,6 +68,15 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
});
}
public
function
register
(
ExtensionInterface
$extension
,
array
$values
)
{
foreach
(
$values
as
$key
=>
$value
)
{
$this
[
$key
]
=
$value
;
}
$extension
->
register
(
$this
);
}
/**
* Maps a pattern to a callable.
*
...
...
src/Silex/ExtensionInterface.php
0 → 100644
View file @
c6747411
<?php
/*
* This file is part of the Silex framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Silex
;
interface
ExtensionInterface
{
function
register
(
Application
$app
);
}
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