Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Removed invalid examples#8986
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.
Conversation
Templating isn't a service in Symfony 4+ (even after `composer req templating`), so probably we're looking for the twig service.The Router service isn't public and can therefor not be called from the container:```Information for Service "router.default"======================================== ---------------- ----------------------------------------------- Option Value ---------------- ----------------------------------------------- Service ID router.default Class Symfony\Bundle\FrameworkBundle\Routing\Router Tags - Calls setConfigCacheFactory Public no Synthetic no Lazy no Shared yes Abstract no Autowired no Autoconfigured no ---------------- -----------------------------------------------```
javiereguiluz commentedJan 5, 2018
Maybe it's time to remove theAccessing the Container Directly section entirely.@weaverryan what do you think? |
weaverryan commentedJan 5, 2018
Yea, I agree: we should remove this section entirely. Could you do that@TheDevilOnLine? |
Removed "Accessing the Container Directly" section, as this way of work is currently deprecated.
TheDevilOnLine commentedJan 5, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@weaverryan Done. Can you guys do the squashing when doing the merge? Want me to check the rest of the documentation for these kind of container usage as well? |
weaverryan commentedJan 5, 2018
@TheDevilOnLine Yep, no worries - we'll handle the squashing.
YES! I was literallyjust thinking this as I opened up your PR. There probably are a few legit cases still, but yea, we need to check all the docs to be sure. Thanks! |
…jection over Container. Includes changes from PRsymfony#8985
TheDevilOnLine commentedJan 5, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I've went over the documentation and checked all instances containing The only thing I didn't know for sure (which might improve the documentation), is if there's a way to get a Doctrine EntityManager, other than the default one, through dependency injection. If this is possible, I think it's a good idea to add this information to multiple_entity_managers.rst as well I think the only other way is to inject the complete doctrine service, and call |
javiereguiluz commentedJan 7, 2018
@TheDevilOnLine thanks for updating all this and congrats on your first contribution to Symfony Docs! |
… javiereguiluz)This PR was merged into the 4.0 branch.Discussion----------Removed invalid examplesTemplating isn't a service in Symfony 4+ (even after `composer req templating`), so probably we're looking for the twig service.The Router service isn't public and can therefor not be called from the container:```$ php bin/console debug:container router // This service is an alias for the service router.defaultInformation for Service "router.default"======================================== ---------------- ----------------------------------------------- Option Value ---------------- ----------------------------------------------- Service ID router.default Class Symfony\Bundle\FrameworkBundle\Routing\Router Tags - Calls setConfigCacheFactory Public no Synthetic no Lazy no Shared yes Abstract no Autowired no Autoconfigured no ---------------- -----------------------------------------------```Commits-------3492028 Use controller method injection instead of the constructorf9091b0 Updated documentation to reflect best practice of using Dependency Injection over Container. Includes changes from PR#898518e6d9e Removed "Accessing the Container Directly"89e38ef Removed invalid examples
Templating isn't a service in Symfony 4+ (even after
composer req templating), so probably we're looking for the twig service.The Router service isn't public and can therefor not be called from the container: