Skip to content

[RFC] advance sample on internals rewrite #2405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions book/internals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ variables:
:class:`Symfony\\Component\\HttpFoundation\\SessionStorage\\SessionStorageInterface`
interface abstract session management ``session_*()`` functions.

.. note::

Read more about the :doc:`HttpFoundation Component </components/http_foudation/introduction>`.

``HttpKernel`` Component
~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -58,6 +62,7 @@ Dependency Injection component and a powerful plugin system (bundles).

.. seealso::

Read more about the :doc:`HttpKernel Component </components/http_kernel/introduction>`.
Read more about :doc:`Dependency Injection </book/service_container>` and
:doc:`Bundles </cookbook/bundles/best_practices>`.

Expand Down Expand Up @@ -234,6 +239,7 @@ add the following code at the beginning of your listener method::
:doc:`Event Dispatcher Component Documentation</components/event_dispatcher/introduction>`
section first.


.. index::
single: Event; kernel.request

Expand All @@ -256,6 +262,10 @@ uses a :class:`Symfony\\Component\\Routing\\RouterInterface` object to match
the ``Request`` and determine the Controller name (stored in the
``_controller`` ``Request`` attribute).

.. seealso::

Read more on the :ref:`kernel.request event <component-http-kernel-kernel-request>`.

.. index::
single: Event; kernel.controller

Expand All @@ -278,6 +288,10 @@ to modify the controller that should be executed::
$event->setController($controller);
}

.. seealso::

Read more on the :ref:`kernel.controller event <component-http-kernel-kernel-controller>`.

.. index::
single: Event; kernel.view

Expand Down Expand Up @@ -307,6 +321,10 @@ The value returned by the Controller is accessible via the
$event->setResponse($response);
}

.. seealso::

Read more on the :ref:`kernel.view event <component-http-kernel-kernel-view>`.

.. index::
single: Event; kernel.response

Expand Down Expand Up @@ -340,6 +358,24 @@ The ``FrameworkBundle`` registers several listeners:
``Surrogate-Control`` HTTP header when the Response needs to be parsed for
ESI tags.

.. seealso::

Read more on the :ref:`kernel.response event <component-http-kernel-kernel-response>`.

.. index::
single: Event; kernel.terminate

``kernel.terminate`` Event
..........................

.. versionadded:: 2.1
The ``kernel.terminate`` event is new since Symfony 2.1.

.. seealso::

Read more on the :ref:`kernel.terminate event <component-http-kernel-kernel-terminate>`.


.. index::
single: Event; kernel.exception

Expand Down Expand Up @@ -383,6 +419,10 @@ and set a new ``Exception`` object, or do nothing::

return new Response('Error', 404 /* ignored */, array('X-Status-Code' => 200));

.. seealso::

Read more on the :ref:`kernel.exception event <component-http-kernel-kernel-exception>`.

.. index::
single: Event Dispatcher

Expand Down
4 changes: 4 additions & 0 deletions components/http_kernel/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ will be called after another event - ``kernel.controller`` - is dispatched.
There are also a few other variations on the above process (e.g. if
you're registering your controllers as services).

.. _component-http-kernel-kernel-controller:

3) The ``kernel.controller`` event
----------------------------------

Expand Down Expand Up @@ -444,6 +446,8 @@ method, which sends the headers and prints the ``Response`` content.
serializes the current user's information into the
session so that it can be reloaded on the next request.

.. _component-http-kernel-kernel-terminate:

8) The ``kernel.terminate`` event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down