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
b37da111
Commit
b37da111
authored
Apr 04, 2011
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[docs] add cross-references to Symfony2 API docs
parent
5dcf618d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
19 deletions
+31
-19
doc/extensions/url_generator.rst
doc/extensions/url_generator.rst
+5
-3
doc/internals.rst
doc/internals.rst
+14
-7
doc/services.rst
doc/services.rst
+6
-6
doc/usage.rst
doc/usage.rst
+6
-3
No files found.
doc/extensions/url_generator.rst
View file @
b37da111
...
...
@@ -12,9 +12,11 @@ None.
Services
--------
* **url_generator**: An instance of
``Symfony\Component\Routing\Generator\UrlGenerator``, using the
``RouteCollection`` that is provided through the ``routes`` service.
* **url_generator**: An instance of `UrlGenerator
<http://api.symfony.com/2.0/Symfony/Component/Routing/Generator/UrlGenerator.html>`_,
using the `RouteCollection
<http://api.symfony.com/2.0/Symfony/Component/Routing/RouteCollection.html>`_
that is provided through the ``routes`` service.
It has a ``generate`` method, which takes the route name as an argument,
followed by an array of route parameters.
...
...
doc/internals.rst
View file @
b37da111
...
...
@@ -11,16 +11,20 @@ Application
~~~~~~~~~~~
The application is the main interface to Silex. It
implements Symfony2's ``HttpKernelInterface``, so you can
pass a ``Request`` to the ``handle`` method and it will
return a ``Response``.
implements Symfony2's `HttpKernelInterface
<http://api.symfony.com/2.0/Symfony/Component/HttpKernel/HttpKernelInterface.html>`_,
so you can pass a `Request
<http://api.symfony.com/2.0/Symfony/Component/HttpFoundation/Request.html>`_
to the ``handle`` method and it will return a `Response
<http://api.symfony.com/2.0/Symfony/Component/HttpFoundation/Response.html>`_.
It extends the ``Pimple`` service container, allowing
for flexibility on the outside as well as the inside. you
could replace any service, and you are also able to read
them.
The application makes strong use of the ``EventDispatcher``
The application makes strong use of the `EventDispatcher
<http://api.symfony.com/2.0/Symfony/Component/EventDispatcher/EventDispatcher.html>`_
to hook into the Symfony2 HttpKernel events. This allows
fetching the ``Request``, converting string responses into
``Response`` objects and handling Exceptions. We also use it
...
...
@@ -30,7 +34,9 @@ errors.
Controller
~~~~~~~~~~
The Symfony2 ``Route`` is actually quite powerful. Routes
The Symfony2 `Route
<http://api.symfony.com/2.0/Symfony/Component/Routing/Route.html>`_
is actually quite powerful. Routes
can be named, which allows for URL generation. They can
also have requirements for the variable parts. In order
to allow settings these through a nice interface the
...
...
@@ -41,8 +47,9 @@ a route.
ControllerCollection
~~~~~~~~~~~~~~~~~~~~
One of the goals of exposing the ``RouteCollection`` was
to make it mutable, so extensions could add stuff to it.
One of the goals of exposing the `RouteCollection
<http://api.symfony.com/2.0/Symfony/Component/Routing/RouteCollection.html>`_
was to make it mutable, so extensions could add stuff to it.
The challenge here is the fact that routes know nothing
about their name. The name only has meaning in context
of the ``RouteCollection`` and cannot be changed.
...
...
doc/services.rst
View file @
b37da111
...
...
@@ -188,7 +188,7 @@ or replaced. You probably don't want to mess with most
of them.
* **request**: Contains the current request object,
which is an instance of `
Symfony\Component\HttpFoundation\
Request
which is an instance of `Request
<http://api.symfony.com/2.0/Symfony/Component/HttpFoundation/Request.html>`_.
It gives you access to ``GET``, ``POST`` parameters
and lots more!
...
...
@@ -198,7 +198,7 @@ of them.
$id = $app['request']->get('id');
* **autoloader**: This service provides you with a
`
Symfony\Component\ClassLoader\
UniversalClassLoader
`UniversalClassLoader
<http://api.symfony.com/2.0/Symfony/Component/ClassLoader/UniversalClassLoader.html>`_
that is already registered. You can register prefixes
and namespaces on it.
...
...
@@ -207,7 +207,7 @@ of them.
$app['autoloader']->registerPrefix('Twig_', $app['twig.class_path']);
* **routes**: The `
Symfony\Component\Routing\
RouteCollection
* **routes**: The `RouteCollection
<http://api.symfony.com/2.0/Symfony/Component/Routing/RouteCollection.html>`_
that is used internally. You can add, modify, read
routes.
...
...
@@ -216,17 +216,17 @@ of them.
that is used internally. Check the *Internals*
chapter for more information.
* **dispatcher**: The `
Symfony\Component\EventDispatcher\
EventDispatcher
* **dispatcher**: The `EventDispatcher
<http://api.symfony.com/2.0/Symfony/Component/EventDispatcher/EventDispatcher.html>`_
that is used internally. It is the core of the Symfony2
system and is used quite a bit by Silex.
* **resolver**: The `
Symfony\Component\HttpKernel\Controller\
ControllerResolver
* **resolver**: The `ControllerResolver
<http://api.symfony.com/2.0/Symfony/Component/HttpKernel/Controller/ControllerResolver.html>`_
that is used internally. It takes care of executing the
controller with the right arguments.
* **kernel**: The `
Symfony\Component\HttpKernel\
HttpKernel
* **kernel**: The `HttpKernel
<http://api.symfony.com/2.0/Symfony/Component/HttpKernel/HttpKernel.html>`_
that is used internally. The HttpKernel is the heart of
Symfony2, it takes a Request as input and returns a
...
...
doc/usage.rst
View file @
b37da111
...
...
@@ -176,16 +176,19 @@ set up a message and send that message.
The current ``request`` service is retrieved using the array key syntax.
You can find more information about services in the *Services* chapter.
The request is an instance of ``Symfony\Component\HttpFoundation\Request``,
The request is an instance of `Request
<http://api.symfony.com/2.0/Symfony/Component/HttpFoundation/Request.html>`_,
so you can fetch variables using the request's ``get`` method.
Instead of returning a string we are returning an instance of
``Symfony\Component\HttpFoundation\Response``. This allows setting an HTTP
`Response
<http://api.symfony.com/2.0/Symfony/Component/HttpFoundation/Response.html>`_.
This allows setting an HTTP
status code, in this case it is set to ``201 Created``.
.. note::
Silex always uses ``Response`` internally, it converts strings to
Silex always uses
a
``Response`` internally, it converts strings to
responses with status code ``200 Ok``.
Other methods
...
...
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