Yes, by default Symfony Flex run at least register bundles in config/bundles.php even if the bundle does not have a recipe in both "symfony/recipes" and "symfony/recipes-contrib" repositories. If you use Git, you can commit all changes, then install the bundle and check diff with "git diff" command - you'll see that bundles.php was changed and that's it, no additional files were created, modified, etc. That's exactly what mean the output in your case.
And yes, it because of symfony-bundle type, that's how Symfony Flex knows that you're installing a bundle.
Did you run: "composer require twig"? Do you have Flex in your project? What version of the bundle did you install? And do you have the latest Composer version installed? Because Twig bundle already has a recipe, see: https://github.com/symfony/... , so it should create a config file for you in the config/packages/twig.yaml path where you need to write its configuration instead of app/config/config.yml. Also, this screencast may be interesting for you to figure out the difference between Symfony 3 and 4 version: https://knpuniversity.com/s... .
But if you don't have this config/packages/twig.yaml - you can create it manually, but probably you just need to reinstall (remove and install again) the bundle.
5 Comments
In addition to the lesson.
Running the command:
composer require knplabs/knp-menu-bundle
Among other logs, get:
Symfony operations: 1 recipe (b8582560d80e1e5da8d9bd613b6bf8f0)
- Configuring knplabs / knp-menu-bundle (>=v2.2.1): From auto-generated recipe
Where is this recipe?
Because "knplabs / knp-menu-bundle" has "type": "symfony-bundle"?
Hey Maxim,
Yes, by default Symfony Flex run at least register bundles in config/bundles.php even if the bundle does not have a recipe in both "symfony/recipes" and "symfony/recipes-contrib" repositories. If you use Git, you can commit all changes, then install the bundle and check diff with "git diff" command - you'll see that bundles.php was changed and that's it, no additional files were created, modified, etc. That's exactly what mean the output in your case.
And yes, it because of symfony-bundle type, that's how Symfony Flex knows that you're installing a bundle.
Cheers!
I installed the bundle and it requires to make changes to the file app/config/config.yml. But in symphony 4 there is no such file by default.
Also, Bundle did not create the *.yaml file in the "packages" directory.
Can I create the app/config/config.yml file manually? How can I add such settings to symphony 4?
Thank you.
Hey Dmitriy,
Did you run: "composer require twig"? Do you have Flex in your project? What version of the bundle did you install? And do you have the latest Composer version installed? Because Twig bundle already has a recipe, see: https://github.com/symfony/... , so it should create a config file for you in the config/packages/twig.yaml path where you need to write its configuration instead of app/config/config.yml. Also, this screencast may be interesting for you to figure out the difference between Symfony 3 and 4 version: https://knpuniversity.com/s... .
But if you don't have this config/packages/twig.yaml - you can create it manually, but probably you just need to reinstall (remove and install again) the bundle.
Cheers!
Thank you, Victor. I create manually file in config/packages/name_bundle.yaml. All works!
"Houston: no signs of life"
Start the conversation!