0

I've created Magento 2 modules, now when I trying to validate my code with Magento code validator and I`m getting 'Unescaped output detected' in phtml templates where calling custom HTML attributes.

The problem is that I can't use escapeHtml method because my content is Html and shouldn't be converted to string.

I want to know how can I fix this issue

1 Answer 1

0

use php echo short syntax with no escape.see below code:

  <div class="actions-toolbar">
        <?= /* @noEscape */ $block->getActions($item) ?>
  </div>

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.