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
4e36a6a4
Commit
4e36a6a4
authored
Feb 06, 2013
by
Victor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc tweaks
parent
22a8fea7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
doc/usage.rst
doc/usage.rst
+3
-0
src/Silex/Application.php
src/Silex/Application.php
+4
-5
No files found.
doc/usage.rst
View file @
4e36a6a4
...
...
@@ -171,6 +171,9 @@ Now, you can create another controller for viewing individual blog posts::
This route definition has a variable ``{id}`` part which is passed to the
closure.
The current ``application`` is automatically injected by Silex to the Closure
thanks to the type hinting.
When the post does not exist, we are using ``abort()`` to stop the request
early. It actually throws an exception, which we will see how to handle later
on.
...
...
src/Silex/Application.php
View file @
4e36a6a4
...
...
@@ -26,7 +26,6 @@ use Symfony\Component\HttpFoundation\Response;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\HttpFoundation\StreamedResponse
;
use
Symfony\Component\HttpFoundation\JsonResponse
;
use
Symfony\Component\EventDispatcher\Event
;
use
Symfony\Component\Routing\RouteCollection
;
use
Symfony\Component\Routing\RequestContext
;
use
Silex\RedirectableUrlMatcher
;
...
...
@@ -254,7 +253,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
* Adds an event listener that listens on the specified events.
*
* @param string $eventName The event to listen on
* @param callable $
listener
The listener
* @param callable $
callback
The listener
* @param integer $priority The higher this value, the earlier an event
* listener will be triggered in the chain (defaults to 0)
*/
...
...
@@ -373,7 +372,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
* @param string $url The URL to redirect to
* @param integer $status The status code (302 by default)
*
* @
see
RedirectResponse
* @
return
RedirectResponse
*/
public
function
redirect
(
$url
,
$status
=
302
)
{
...
...
@@ -387,7 +386,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
* @param integer $status The response status code
* @param array $headers An array of response headers
*
* @
see
StreamedResponse
* @
return
StreamedResponse
*/
public
function
stream
(
$callback
=
null
,
$status
=
200
,
$headers
=
array
())
{
...
...
@@ -416,7 +415,7 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
* @param integer $status The response status code
* @param array $headers An array of response headers
*
* @
see
JsonResponse
* @
return
JsonResponse
*/
public
function
json
(
$data
=
array
(),
$status
=
200
,
$headers
=
array
())
{
...
...
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