Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Routes 无法将请求的控制器分配给控制器类zf2_Routes_Zend Framework2 - Fatal编程技术网

Routes 无法将请求的控制器分配给控制器类zf2

Routes 无法将请求的控制器分配给控制器类zf2,routes,zend-framework2,Routes,Zend Framework2,Rout的定义如module.config中所述,它将转到该Rout,但如上所述,给出了一个错误,即控制器未分配给任何类 return array( 'controllers' => array( 'classes' => array( 'Reisesparer\Controller\Index' => 'Reisesparer\Controller\IndexController', 'Reisesparer\Controller\Payment'

Rout的定义如module.config中所述,它将转到该Rout,但如上所述,给出了一个错误,即控制器未分配给任何类

 return array(
'controllers' => array(

    'classes' => array(
    'Reisesparer\Controller\Index' => 'Reisesparer\Controller\IndexController',
    'Reisesparer\Controller\Payment' => 'Reisesparer\Controller\PaymentController',
    ),

    'invokables' => array(
        'Reisesparer\Controller\Index' => 'Reisesparer\Controller\IndexController',
        'Reisesparer\Controller\Payment' => 'Reisesparer\Controller\PaymentController',
    ),

'payment_done' => array(
   'type' => 'segment',
   'options' => array(
   'route'    => '/payment/done[/:payum_token]',
   'defaults' => array(
   '__NAMESPACE__' => 'Reisespare\Controller',
   'controller' => 'Payment',
   'action' => 'done'
       ),
     ),
   ),
这里,控制器方法:

namespace Reisesparer\Controller;

 use Payum\Core\Request\GetHumanStatus;
 use Zend\Mvc\Controller\AbstractActionController;
 use Zend\Di\ServiceLocator;
 use Zend\View\Model\JsonModel;

 class PaymentController extends AbstractActionController
 {
    public function doneAction()
    {
    $token = $this->getServiceLocator()->get('payum.security.http_request_verifier')->verify($this);

    $gateway = $this->getServiceLocator()->get('payum')->getgateway($token->getgatewayName());

    $gateway->execute($status = new GetHumanStatus($token));

    return new JsonModel(array('status' => $status->getValue(), 'details' => iterator_to_array($status->getFirstModel())));
  }
}

关于如何解决这个问题有什么帮助吗?

你能编辑你的帖子并添加准确的错误/异常吗?我也不知道你配置中的
键是什么。解释可用的配置键及其功能。