Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[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
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| { | ||
| @@ -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 | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Member There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| -------------------- | ||