Commit 185be1eb authored by Fabien Potencier's avatar Fabien Potencier

minor #940 Fix typos, remove trailing whitespace (ifdattic)

This PR was merged into the 1.0 branch.

Discussion
----------

Fix typos, remove trailing whitespace

Commits
-------

502d1049 Fix typos
parents ddcec079 502d1049
...@@ -32,8 +32,8 @@ By calling ``handle``, you can make a sub-request manually. Here's an example:: ...@@ -32,8 +32,8 @@ By calling ``handle``, you can make a sub-request manually. Here's an example::
$response = $app->handle($subRequest, HttpKernelInterface::SUB_REQUEST, false); $response = $app->handle($subRequest, HttpKernelInterface::SUB_REQUEST, false);
There's some more things that you need to keep in mind though. In most cases There's some more things that you need to keep in mind though. In most cases
you will want to forward some parts of the current master request to the sub- you will want to forward some parts of the current master request to the
request. That includes: Cookies, server information, session. sub-request. That includes: Cookies, server information, session.
Here is a more advanced example that forwards said information (``$request`` Here is a more advanced example that forwards said information (``$request``
holds the master request):: holds the master request)::
......
...@@ -127,8 +127,7 @@ example:: ...@@ -127,8 +127,7 @@ example::
return $app['twig']->render('index.twig', array('form' => $form->createView())); return $app['twig']->render('index.twig', array('form' => $form->createView()));
}); });
And here is the ``index.twig`` form template (requires ``symfony/twig- And here is the ``index.twig`` form template (requires ``symfony/twig-bridge``):
bridge``):
.. code-block:: jinja .. code-block:: jinja
......
...@@ -13,7 +13,7 @@ Parameters ...@@ -13,7 +13,7 @@ Parameters
* **monolog.logfile**: File where logs are written to. * **monolog.logfile**: File where logs are written to.
* **monolog.level** (optional): Level of logging defaults * **monolog.level** (optional): Level of logging, defaults
to ``DEBUG``. Must be one of ``Logger::DEBUG``, ``Logger::INFO``, to ``DEBUG``. Must be one of ``Logger::DEBUG``, ``Logger::INFO``,
``Logger::WARNING``, ``Logger::ERROR``. ``DEBUG`` will log ``Logger::WARNING``, ``Logger::ERROR``. ``DEBUG`` will log
everything, ``INFO`` will log everything except ``DEBUG``, everything, ``INFO`` will log everything except ``DEBUG``,
......
...@@ -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)
)); ));
......
...@@ -462,7 +462,7 @@ the defaults for new controllers. ...@@ -462,7 +462,7 @@ the defaults for new controllers.
.. note:: .. note::
The global configuration does not apply to controller providers you might The global configuration does not apply to controller providers you might
mount as they have their own global configuration (read the mount as they have their own global configuration (read the
:doc:`dedicated chapter<organizing_controllers>` for more information). :doc:`dedicated chapter<organizing_controllers>` for more information).
Error handlers Error handlers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment