-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Override service and configuration #1457
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
Override service and configuration #1457
Conversation
…eter and added section about how to add method calls to services
@weaverryan first of all, congratulations on getting married! I hope you had a great day and that it was worth missing Symfony Live for ;) I've updated the text as per your comments. I decided to keep the part about setting the param from your extension. For example, we use a Framework bundle, which overrides a service of the Symfony FrameworkBundle. I want it to do this automatically whenever it is included in a project, so we don't need to keep all our config.yml's synced. By setting the param in the Extension class, I don't need to worry about this |
@Burgov by setting the param in your DI extension, it works only when registering your bundle after FrameworkBundle (as the last one setting the param will win). And relying on the bundle order is a bad practice (shared bundles should never do it) so the doc should not give it as an example |
class name by setting the parameter directly in the container in the Extension | ||
class of your bundle: | ||
|
||
.. code-block:: html+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.
html+php
? where is the html code ?
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.
http://symfony.com/doc/current/contributing/documentation/format.html states that when code contains <?php
, it should be defined ad html+php
This part will be removed anyway
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.
sure, but there is no need to include <?php
here as you are only showing some PHP code. html+php
is only used for PHP templates in the doc (which indeed mix HTML and PHP)
I clearly need to read up on compiler passes. Had only been using them to define my own tags so far, but I seem to be missing out on a lot of features. I'll experiment with this and rewrite this PR this weekend. @stof Thanks for the pointers |
@stof I've rewritten the text to include info on using Compiler Passes. Do you think the information is sufficient? |
maybe add the following context: your app src code vendor bundles and talk about the best practice for moving custom hacky configuration into compiler passes for overriding vendor bundles configuration? |
Override service and configuration
Hey guys! First, thank you very much - I'm still catching up a little bit from being gone for a week :). I think the information presented here is very good and fills in a section that people were looking for. I did make some modifications and additions - if you see any issues, please let me know. Thank you! |
reopened #1421 based on the correct branch