Description
Description
Hi there,
Part of the folder-free initiative, controllers are unfortunately not totally movable right now,
Thing is a config in config/route.yaml wants to know where the controllers are and what the namespace is; I feel like those parameters are artifact of the old system, and maybe we can get rid of them to just let the container check in all src/default code folder, list the controllers (#[AsController]
, #[Route]
or extends AbstractController
) once and for all, cache them and live with it? Could it be a perfect fit for deprecation 7.4/removal 8.0?
This would save few lines of config, again, and improve DX by letting dev choose where to put the controllers... Problem is maybe the same than Doctrine's ORM Entity scan, as I don't know if right now, if I tell the config "scan all src/" I will not crash the performances, or create weird bugs?
Example
Current:
- src/
- Controller/
- OrganizationController.php
- Controller/
Instead:
- src/
- Organization/
- Controller/
- MyInvokableIndexController.php
- GeneralCrudController.php
- Controller/
- Organization/