我们可以用unsetBlock()方法删除Magento1中的块,但是在Magento2中它不起作用.那么,请帮助如何以编程方式删除Magento2中的块?
小智 13
使用unsetElement()方法删除块.就像
$layout = $this->getLayout();
$block = $layout->getBlock('catalog.topnav'); // block name
$layout->unsetElement('catalog.topnav');
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2890 次 |
| 最近记录: |