Jump to content

Erreur lors du développement d'un module : The controller is not callable


Recommended Posts

Bonjour à tous,

j'essaie de développer un module pour Prestashop 8/9, donc avec les Controller Symfony.

Voici le contenu d'un de mes Controller : 

namespace PrestaShop\Module\MyCustom\Controller;

if (!defined('_PS_VERSION_')) {
    exit;
}

class MyCustomLoginAdminController extends AbstractMyCustomAdminController
{
    public function indexAction(Request $request)
    {
      ....
    }
}

Avec : 

namespace PrestaShop\Module\MyCustom\Controller;

if (!defined('_PS_VERSION_')) {
    exit;
}

use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController;

abstract class AbstractMyCustomAdminController extends FrameworkBundleAdminController
{
 ....
}

Voici mon routes.yaml

mycustom_login:
  path: mycustom/login
  methods: [GET, POST]
  defaults:
    _controller: MyCustom\Controller\MyCustomLoginAdminController::indexAction
    _legacy_controller: 'MyCustomLoginAdminController'
    _legacy_link: 'MyCustomLoginAdminController'

Et mon composer.json :

  "autoload": {
    "psr-4": {
      "PrestaShop\\Module\\MyCustom\\": "src/"
    }
  },

Tout me parait bon, malgré cela, j'ai cette erreur

Quote

The controller for URI "/modules/mycustom/login" is not callable: Controller "MyCustom\Controller\MyCustomLoginAdminController" does neither exist as service nor as class.

Que faut-il configurer de plus ? j'ai copié / collé le BlockWishList, suivi la doc, vidé le cache. Je vous remercie.

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...