Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

EasyAdmin: is there any way to have entity's fileds when calling setTemplatePath method in easyadmin?

$
0
0

Is there any way to get more than one filed of an entity when calling setTemplatePath() method in easyadmin ?

for example :

I have an entity called OperatorSystem which has 3 properties : id, label and status.

I want to show operator label based on status flag. So in my twig file I need both label and status.

I tried to call entity.status but it doesn't work.

For now I can show in my twig the operator's name like this:

{% set operator = field.value|upper %}

But I need to have status for if else condition.

public function configureFields(string $pageName): iterable    {    yield TextField::new(SystemConstants::FIELD_OPERATOR_ID)                ->setLabel(SystemConstants::FIELD_OPERATOR_LABEL)                ->setSortable(false)                ->setHelp(SystemConstants::FIELD_OPERATOR_HELP)                ->setTemplatePath(UtilityConstants::OPERATOR_TEMPLATE_PATH);

Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>