繁体   English   中英

如何在 crud controller (Symfony 6 + EasyAdmin 4) 的详细页面中显示特定实体实例的数组属性的值

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM