Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

101
Visualizações
The requested controller was unable to dispatch the request

Hi, im newbie in Zend Framework and have been developing a Application so that i can get more familiar with it.
The Application has Authentication and Session treatment plus a Users Management for the admin(User Module).
The Application also has a module for "Modules" with the actions "admin", "add", "view", "edit" and "delete".
My index view prints out all modules order by id but since the list of modules contains more than 30 modules, it would be better for page to have a filtering by Module Category.
My logic was to create a action function for filtering in the ModuleController(where all the other actions are), declare it in my "module.config.php" under the "acess_filter" array :

 'access_filter' => [
    'options' => [
        'mode' => 'restrictive'
    ],
    'controllers' => [
        Controller\IndexController::class => [
            // Allow anyone to visit "index" and "about" actions
            ['actions' => ['index', 'about'], 'allow' => '*'],
            // Allow authorized users to visit "settings" action
            ['actions' => ['settings'], 'allow' => '@']
        ],
        Controller\ModuloController::class => [
            ['actions' => ['admin'], 'allow' => '*'],
            ['actions' => ['admin', 'view', 'view_comu','add','edit','delete'], 'allow' => '@']

        ],
    ]
],

When i tried to access the module action this error prompt:
"The requested controller was unable to dispatch the request.

Controller: Application\Controller\ModuloController "

Did i miss something?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

You are probably missing another controllers key somewhere in your configuration (the root controllers key that contains the configuration for the controllers container).

It should look like this:

return [
    'controllers' => [
        'factories' => [
            Controller\IndexController::class => Controller\IndexControllerFactory::class,
            Controller\ModuloController::class => Controller\ModuloControllerFactory::class,
        ],
    ],
];
over 4 years ago · Santiago Trujillo Relatório

0

This error can also appear if you write the path in the address bar like /path/to/controller and don't specify the default action when you set may_terminate = true. Adding action to the path, like /path/to/controller/action, solves the problem.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda