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
67639888
Commit
67639888
authored
Apr 15, 2014
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.0' into 1.1
* 1.0: Fix typos
parents
33da608a
185be1eb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
+9
-10
doc/cookbook/sub_requests.rst
doc/cookbook/sub_requests.rst
+2
-2
doc/providers/form.rst
doc/providers/form.rst
+1
-2
doc/providers/monolog.rst
doc/providers/monolog.rst
+1
-1
doc/providers/serializer.rst
doc/providers/serializer.rst
+5
-5
No files found.
doc/cookbook/sub_requests.rst
View file @
67639888
...
@@ -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)::
...
...
doc/providers/form.rst
View file @
67639888
...
@@ -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
...
...
doc/providers/monolog.rst
View file @
67639888
...
@@ -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``,
...
...
doc/providers/serializer.rst
View file @
67639888
...
@@ -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