
[英]How to display associated objects with links to their details page in Symfony 5 EasyAdmin 3?
[英]How to display the values of an array property of an instance of a specific entity in detail page of a crud controller (Symfony 6 + EasyAdmin 4)
如何在 crud controller (Symfony 6 + EasyAdmin 4) 的详细页面中显示特定实体实例的数组属性的值
TestCrudController代码
<?php
class TestCrudController extends AbstractCrudController
{
// some codes
public function configureFields($pageName)
{
// some codes
foreach($values as $value) {
$dataCode = $value->getCode();
$dataType = $value->getChoices()->getType();
$dataTitle = $value->getChoices()->getTitle();
$dataValue = $value->getValue();
$fields[] = ArrayField::new('value', $dataTitle)
->onlyOnDetail();
// iam searching for method to set the specific object
}
return $fields;
}
}
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.