Routes 无法将请求的控制器分配给控制器类zf2
Rout的定义如module.config中所述,它将转到该Rout,但如上所述,给出了一个错误,即控制器未分配给任何类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'
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())));
}
}
关于如何解决这个问题有什么帮助吗?你能编辑你的帖子并添加准确的错误/异常吗?我也不知道你配置中的
类
键是什么。解释可用的配置键及其功能。