I need some help with a problem I have with a module, I know this is a newbie question but here i go.

<div class="field company <?= $block->isrequiered() ? 'required' : '' ?>">

How do I make this optional instead of required?

1 Answer 1


This is Ternary Condition

so basically if $block->isrequiered() getting then apply 'required' class otherwise black class add

If you don't want to add condition just remove condition

<div class="field company">
  • Thank you for your answer, but i do not understand what you mean. Commented Nov 23, 2021 at 14:42
  • Can't you delete the entire php block ('<?= $block->isrequiered() ? 'required' : '' ?>')? if it is not required, then it is optional right? Commented Nov 23, 2021 at 14:48
  • Yes this is simple condition let me explain in my answer Commented Nov 23, 2021 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.