Symfony - Missing controller that is called nowhere

Hello,

I’ve got an error message in symfony :slight_smile:

Class AppBundle\Controller\TasksFormController does not exist in /mnt/400Go/www/sy1/src/AppBundle/Controller/ (which is being imported from “/mnt/400Go/www/sy1/app/config/routing.yml”).

Easy to understand : a route calls a controller and does not find it. Except that no route calls this controller any more. Here’s my routing.yml :

app:
    resource: "@AppBundle/Controller/"
    type:     annotation

Homepage:
    path: /
    defaults:  { _controller: AppBundle:Home:home }

Homepage:
    path: /home
    defaults:  { _controller: AppBundle:Home:home }

BackgroundImagesResizeGD1:
    path:     /Ajax
    defaults: { _controller: AppBundle:Ajax:BackgroundImagesResizeGD1 }

BackgroundImagesResizeGD1a:
    path:     /Ajax/BackgroundImagesResizeGD1
    defaults: { _controller: AppBundle:Ajax:BackgroundImagesResizeGD1 }

TaskCreated:
    path:     /TaskCreated
    defaults: { _controller: AppBundle:TaskCreated:taskCreated }

OtherPages:
    path:      /{currentPage}
    defaults:  { _controller: AppBundle:Others:show }

Can’t ask “bin/console debug:router” or “cache:clear”, for both issue the same error message.
I wiped the cache (deleting its sub dirs), and also sessions. Nope, Symfony will wail about this missing controller.

Where should I look to solve this error ? Thanks in advance.

MC

Comment out the above lines and try again. Mixing annotations and explicit routes seldom ends well.

Then grep through you code and see where TasksFormController is being called from. It’s almost like you have a typo somewhere that probably should have been TasksForm or maybe TasksFormType.

Right, modifying the routing.yml was the solution.

The code :

app:
resource: "@AppBundle/Controller/"
type: annotation

… is used to embed routes in annotations in the controllers.

Thanks a lot,

MC

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.