Ohh, I get it now. Then, no, I think you should start heading towards to a non-bundle structure, this will be helpful if you ever decide to upgrade to Symfony4. If that's not your case, then you can have a main services.yaml file in your "app/config" directory and in there set those keys for autowiring and autoconfigure. Or, if you are going to keep adding new bundles into the project, then you can add those keys to the new services.yaml files.
Ok, thanks ! Do you have any tips / hints on how to migrate from a bundle structure to a non-bundle structure when you have around 40 bundles living in ./src ?
Hello Ryan, i see two new services in the services.yml file :
app.encouraging_message_generator: class: AppBundle\Service\MessageGenerator arguments: - ['You can do it!', 'Dude, sweet!', 'Woot!'] app.discouraging_message_generator: class: AppBundle\Service\MessageGenerator arguments: - ['We are *never* going to figure this out', 'Why even try again?', 'Facepalm']
But i don't find the course where we are created them. Can you help me ?
Those services already came with the course code, but don't worry too much about them, they exist purely to demonstrate a couple of examples in the further episodes
9 Comments
Hi !
I have like 40 differents services.yml in my app.
Shall I add these keys in all this 40 files ?
Hey Geoffrey M.
40
services.yamlfiles? Can I ask why? In theory you only have one but it's pretty common to have one for prod, one for dev and one for testingHey MolloKhan
Because my app got around 40 differents bundles and each bundle has its own services declared in their own Resources/config/services.yml.
Ohh, I get it now. Then, no, I think you should start heading towards to a non-bundle structure, this will be helpful if you ever decide to upgrade to Symfony4. If that's not your case, then you can have a main services.yaml file in your "app/config" directory and in there set those keys for autowiring and autoconfigure. Or, if you are going to keep adding new bundles into the project, then you can add those keys to the new services.yaml files.
Cheers!
Ok, thanks ! Do you have any tips / hints on how to migrate from a bundle structure to a non-bundle structure when you have around 40 bundles living in ./src ?
Don't worry Geoffrey, we have your back covered with a full course of how to upgrade from Symfony3 to 4
Check it out: https://symfonycasts.com/sc...
Hello Ryan, i see two new services in the services.yml file :
app.encouraging_message_generator:
class: AppBundle\Service\MessageGenerator
arguments:
- ['You can do it!', 'Dude, sweet!', 'Woot!']
app.discouraging_message_generator:
class: AppBundle\Service\MessageGenerator
arguments:
- ['We are *never* going to figure this out', 'Why even try again?', 'Facepalm']
But i don't find the course where we are created them.
Can you help me ?
Thanks :)
Hey abdouniabdelkarim
Those services already came with the course code, but don't worry too much about them, they exist purely to demonstrate a couple of examples in the further episodes
Cheers!
Thanks you MolloKhan
Cheers!
"Houston: no signs of life"
Start the conversation!