我的文件位于app / design / frontent / vendor_name / theme / Magento_Theme / templates / html / test.phtml
如何在另一个phtml文件,xml布局,静态块和cms页面中调用此文件
请帮忙
In xml layout file
<block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_Theme::html/test.phtml"/>
In cms blocks and cms pages
{{block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_Theme::html/test.phtml"}}
In a phtml file
<?php include ($block->getTemplateFile('Magento_Theme::html/test.phtml')) ?>
1 回答
In xml layout file
In cms blocks and cms pages
In a phtml file