Thứ Sáu, 16 tháng 6, 2017

Get block cms for fontend in magento 2

First you create new block cms, this you need care is  "Identifier"
Why i want you care, because you will use for code after.
Look : setBlockId('id_block')

1
2
3
<?php 
  echo  $call_block = $this->getLayout()->createBlock('cms/block')->setBlockId('id_block')->toHtml();
?>

It very simple !!

if you have any question related, you can comment behind. Thanks

Không có nhận xét nào:

Đăng nhận xét

About me

Recent

recentposts

Random

randomposts