【发布时间】:2016-06-29 20:56:29
【问题描述】:
我尝试在我的 Symfony 控制器中使用另一个 Bundle 的实体:
use Acme\TestBundle\Entity\Neighbour;
use AppBundle\Entity\Home;
class TestController extends Controller {
public function testAction(Home $home, Neighbour $neighbour) {
//
}
}
但这会引发 404 错误:
Acme\TestBundle\Entity\Neighbour object not found
这与像 NeighbourX 这样不存在的真实对象不同,它会引发 500 错误:
Acme\TestBundle\Entity\Neighbour does not exist
对象存在,它应该可以工作,因为它可以工作:
use Acme\TestBundle\Entity\Neighbour;
use AppBundle\Entity\Home;
class TestController extends Controller {
public function testAction(Home $home) {
$thread = new ForumThread();
}
}
【问题讨论】:
标签: php symfony doctrine-orm