Skip to content

Adding some notes on differences when using the full stack framework to ... #1716

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

Merged
Merged
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
11 changes: 11 additions & 0 deletions components/dependency_injection/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ will then be called when the container is compiled::
$container = new ContainerBuilder();
$container->addCompilerPass(new CustomCompilerPass);

.. note::

Compiler passes are registered differently is you are using the full
stack framework, see :doc:`cookbook/service_container/compiler_passes`
for more details.

Controlling the Pass Ordering
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -418,3 +424,8 @@ constructor argument. When the cache is not in debug mode the cached container
will always be used if it exists. In debug mode, an additional metadata file
is written with the timestamps of all the resource files. These are then checked
to see if the files have changed, if they have the cache will be considered stale.

.. note::

In the full stack framework the compilation and caching of the container
is taken care of for you.
12 changes: 9 additions & 3 deletions components/dependency_injection/tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,16 @@ run when the container is compiled::
$container = new ContainerBuilder();
$container->addCompilerPass(new TransportCompilerPass);

.. note::

Compiler passes are registered differently is you are using the full
stack framework, see :doc:`cookbook/service_container/compiler_passes`
for more details.

Adding additional attributes on Tags
------------------------------------

Sometimes you need additional information about each service that's tagged with your tag.
Sometimes you need additional information about each service that's tagged with your tag.
For example, you might want to add an alias to each TransportChain.

To begin with, change the ``TransportChain`` class::
Expand Down Expand Up @@ -212,7 +218,7 @@ To answer this, change the service declaration:
class: \Swift_SendmailTransport
tags:
- { name: acme_mailer.transport, alias: bar }


.. code-block:: xml

Expand All @@ -224,7 +230,7 @@ To answer this, change the service declaration:
<service id="acme_mailer.transport.sendmail" class="\Swift_SendmailTransport">
<tag name="acme_mailer.transport" alias="bar" />
</service>

Notice that you've added a generic ``alias`` key to the tag. To actually
use this, update the compiler::

Expand Down