質問

As we know that we're able to render html content up in front as using below code

echo $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('identifier')->toHtml();

but as I require to display as html content.

For eg: <div>This is static Block </div>

Like this up in front.

役に立ちましたか?

解決

You may try this

$blockHtml = $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('identifier')->toHtml();
echo $block->escapeHtml($blockHtml);
ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top