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
bfe26294
Commit
bfe26294
authored
Oct 26, 2013
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed whitespaces in docs
parent
52b5ab1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
doc/cookbook/multiple_loggers.rst
doc/cookbook/multiple_loggers.rst
+1
-1
doc/providers/serializer.rst
doc/providers/serializer.rst
+5
-5
No files found.
doc/cookbook/multiple_loggers.rst
View file @
bfe26294
...
@@ -44,7 +44,7 @@ on some conventions, such as checking for an array of handlers registered with
...
@@ -44,7 +44,7 @@ on some conventions, such as checking for an array of handlers registered with
the container with the channel name, defaulting to the bundled handler.
the container with the channel name, defaulting to the bundled handler.
.. code-block:: php
.. code-block:: php
use Monolog\Handler\StreamHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Monolog\Logger;
...
...
doc/providers/serializer.rst
View file @
bfe26294
...
@@ -41,22 +41,22 @@ The ``SerializerServiceProvider`` provider provides a ``serializer`` service:
...
@@ -41,22 +41,22 @@ The ``SerializerServiceProvider`` provider provides a ``serializer`` service:
use Silex\Application;
use Silex\Application;
use Silex\Provider\SerializerServiceProvider;
use Silex\Provider\SerializerServiceProvider;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Response;
$app = new Application();
$app = new Application();
$app->register(new SerializerServiceProvider());
$app->register(new SerializerServiceProvider());
// only accept content types supported by the serializer via the assert method.
// only accept content types supported by the serializer via the assert method.
$app->get("/pages/{id}.{_format}", function ($id) use ($app) {
$app->get("/pages/{id}.{_format}", function ($id) use ($app) {
// assume a page_repository service exists that returns Page objects. The
// assume a page_repository service exists that returns Page objects. The
// object returned has getters and setters exposing the state.
// object returned has getters and setters exposing the state.
$page = $app['page_repository']->find($id);
$page = $app['page_repository']->find($id);
$format = $app['request']->getRequestFormat();
$format = $app['request']->getRequestFormat();
if (!$page instanceof Page) {
if (!$page instanceof Page) {
$app->abort("No page found for id: $id");
$app->abort("No page found for id: $id");
}
}
return new Response($app['serializer']->serialize($page, $format), 200, array(
return new Response($app['serializer']->serialize($page, $format), 200, array(
"Content-Type" => $app['request']->getMimeType($format)
"Content-Type" => $app['request']->getMimeType($format)
));
));
...
...
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