-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I was looking for this yesterday and couldn't find it, so I'm hereby updating the doc. This will also fix #9089.
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For XML: e.g. https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services_instanceof.xml
For PHP: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php
There was a problem hiding this comment.
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
Hello @ghost! Thanks for working on this! Would you like to add the other config formats or should we take over your PR? |
I'd suggest adding a "tips" note stating something like: |
This pull request stalled, so I've created #10491 to finish what reviewers asked here. Thanks! |
Documentation related to symfony/symfony#21530 and symfony/symfony-docs issue #9089.
I was looking for this yesterday and couldn't find it, so I'm hereby updating the doc.