G
G
grabbee2019-05-17 18:31:55
symfony
grabbee, 2019-05-17 18:31:55

How to resolve Symfony 4 paths?

Now I was setting up routing, I had to specify the loading of routing from 'src/Resources/config/routing.yml'
Previously, you could specify the path, for example - @AppBundle/Resources/config/routing.yml
Now they have abandoned bundles, but how to write this path now I can't find it anywhere.

Bundle "App" does not exist or it is not enabled ... make sure the bundle path "@App/Resources/config/routing.yml" is not empty.

About how to specify a logical path in the new version, I can not find anywhere. But, judging by the text of the error, in this particular case, symphony searches in folders (does not exist in:)
* /config/routes/dev
* /src
* /src/Resources
That is, it is enough to write config/routing.yml , and it will work - where is it documented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Flying, 2019-05-17
@Flying

This path (more precisely, a set of paths) is specified in MicroKernelTrait::configureRoutes() . To be more precise, this trait defines a method for configuring routing, and the actual code (in its standard form) is part of the Symfony Flex recipe for symfony/framework-bundle, you can see it in the corresponding repository .
If your project is created from symfony/skeleton and, accordingly, uses Symfony Flex, then this code is in src/Kernel.phpyour project and it was added there via recipe.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question