Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Container][Tags] Added a note about _instanceof#9221

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ghost wants to merge2 commits intosymfony:3.3fromunknown repository
Closed
Changes fromall 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
12 changes: 12 additions & 0 deletionsservice_container/tags.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,6 +69,8 @@ that it implements ``Twig_ExtensionInterface``) and adds the tag for you.
interface, call the :method:`Symfony\\Component\\DependencyInjection\\ContainerBuilder::registerForAutoconfiguration`
method in an :doc:`extension </bundles/extension>` or from your kernel::

.. code-block:: php

// app/AppKernel.php
class AppKernel extends Kernel
{
Expand All@@ -82,6 +84,16 @@ that it implements ``Twig_ExtensionInterface``) and adds the tag for you.
}
}

If you do not want to create a custom kernel, it is also possible to use `_instanceof`:

.. code-block:: yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Missing the xml and php documentation format. However, I'm unsure of their notations at this point.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Note that for PHP, setInstanceofConditionals should be called for every single definition, since there is no "file" scope context there


// app/config/services.yml
services:
_instanceof:
AppBundle\Component\CustomInterface:
tags: ['app.custom_tag']

Creating custom Tags
--------------------

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp