magento 2 phtml使用block, phtml

magento 收藏
0 47
在phtml中使用cms block
<?= $this->getLayout()->createBlock(\Magento\Cms\Block\Block::class)->setBlockId('size_guide')->toHtml() ?>

在phtml中使用phtml
<?php echo $this->getLayout()->createBlock("Magento\Framework\View\Element\Template")->setTemplate("Magestore_Webpos::login.phtml")->toHtml() ?>


    暂时没有人评论