Jump to content

The controller for URI "/sell/orders/" is not callable


FabiusM

Recommended Posts

Salve, dovrei implementare ed estendere il controller ordini in backend... di seguito il contesto...

composer.json

{
	"name"     : "author/mymodule",   
	"autoload" : {
	   "psr-4" : {"Namespace1\\" : "src/"},
	   "classmap": ["mymodule.php"],
	   "config": {"prepend-autoloader" : false},
	   "type"  : "prestashop-module"
	}
 }

routes.yml

admin_orders_index:
  path: /sell/orders/
  methods: [GET, POST]
  defaults:
    _controller: 'Namespace1\Controller\Admin\DemoController::indexAction' 
    _legacy_controller: 'AdminOrders'
    _legacy_link: 'AdminOrders'
    _disable_module_prefix: true

DemoController.php

declare(strict_types=1);

namespace NameSpace1\Controller\Admin;

use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController;
use Symfony\Component\HttpFoundation\Request;

class DemoController extends FrameworkBundleAdminController
{
    public function indexAction(Request $request)
    { //write your action to be done 
        echo "CIAO";
    }

}

dopo aver installato le dipendeze con composer ed eliminato la cache mi risulta questo errore

The controller for URI "/sell/orders/" is not callable: Class "EngFatturazione\Controller\Admin\DemoController" does not exist.

Dove sbaglio?

Grazie mille!

Link to comment
Share on other sites

  • 11 months later...

Documentazione assolutamente carente sotto tutti i punti di vista.

non dice che il file services.yml è necessario, altrimenti non funziona assolutamente nulla.

in tuomodulo/config/admin/services.yml
 

services:
  # The name of the service must match the full namespace class
  TuoModulo\Controller\DemoController:
    class: TuoModulo\Controller\DemoController
    tags: ['controller.service_arguments']
    arguments:
      - '@doctrine.cache.provider'

 

Link to comment
Share on other sites

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...