我正在尝试在主捆绑包中调用其中一个捆绑包的方法,但它返回一个错误。我确实做错了什么,但我不知道是什么。
错误:
在null上调用成员函数has()
我在MainBundle中的代码,调用了我的ReviewBundle:
public function indexAction()
{
$reviewController = new \ReviewBundle\Controller\DefaultController();
$reviews = $reviewController->listAction();
return new Response($reviews);
}
listAction应该已经返回了一个Response,所以只需返回它:
public function indexAction()
{
$reviewController = new \ReviewBundle\Controller\DefaultController();
$reviews = $reviewController->listAction();
return $reviews;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句