我使用APYDataGridBundle生成数据表。
我有一个有关系的Person实体(一个健身房可以有更多的人):
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gym", inversedBy="persons")
*/
private $gym;
我在controller中生成了一个包含人员列表的网格:
public function indexAction(Grid $grid)
{
// Creates a simple grid based on your entity (ORM)
$source = new Entity(Person::class);
$grid->setSource($source);
return $grid->getGridResponse('Person/index.html.twig');
它向我展示了具有所有非关系列的网格,但由于关系,健身房列没有。
我在文档中找不到解决方案:https://github.com/APY/APYDataGridBundle/blob/master/Resources/doc/summary.md
你能帮帮我吗?
发布于 2019-06-03 06:02:27
个人实体中:
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gym", inversedBy="persons")
*
* @GRID\Column(field="gym.id", title="Gym ID")
* @GRID\Column(field="gym.title", title="Gym Title")
*/
private $gym;
https://stackoverflow.com/questions/56419192
复制相似问题