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
85ff2522
Commit
85ff2522
authored
Apr 17, 2011
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added some missing phpdoc, fixed doc
parent
17fc85c3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
doc/usage.rst
doc/usage.rst
+1
-1
src/Silex/Application.php
src/Silex/Application.php
+5
-1
src/Silex/LazyApplication.php
src/Silex/LazyApplication.php
+14
-0
No files found.
doc/usage.rst
View file @
85ff2522
...
...
@@ -407,7 +407,7 @@ one::
$blog = require __DIR__.'/blog.php';
$app = new Application();
$app = new
Silex\
Application();
$app->mount('/blog', $blog);
// define your main app
...
...
src/Silex/Application.php
View file @
85ff2522
...
...
@@ -264,7 +264,11 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
public
function
mount
(
$prefix
,
$app
)
{
$prefix
=
rtrim
(
$prefix
,
'/'
);
$this
->
match
(
$prefix
.
'/{path}'
,
$app
)
->
assert
(
'path'
,
'.*'
)
->
value
(
'prefix'
,
$prefix
);
$this
->
match
(
$prefix
.
'/{path}'
,
$app
)
->
assert
(
'path'
,
'.*'
)
->
value
(
'prefix'
,
$prefix
);
}
/**
...
...
src/Silex/LazyApplication.php
View file @
85ff2522
...
...
@@ -22,11 +22,25 @@ class LazyApplication
{
protected
$app
;
/**
* Constructor.
*
* The $app argument is the path to a Silex app file.
* This file must return a Silex application.
*
* @param string $app The absolute path to a Silex app file
*/
public
function
__construct
(
$app
)
{
$this
->
app
=
$app
;
}
/**
* Handles a Request when this application has been mounted under a prefix.
*
* @param Request $request A Request instance
* @param string $path The path info (without the prefix)
*/
public
function
__invoke
(
Request
$request
,
$prefix
)
{
if
(
!
$this
->
app
instanceof
Application
)
{
...
...
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