Calling a Custom phtml file in Magento 2
Calling in phtml file
<?php include ($block->getTemplateFile(‘Magento_Theme::extra/test-view.phtml’)); ?>
Calling in CMS page and block
{{block class=”Magento\Framework\View\Element\Template” name=”test_view” template=”Magento_Theme::extra/test-view.phtml”}}
Calling in XML layout
<block class=”Magento\Framework\View\Element\Template” name=”test_view” template=”Magento_Theme::extra/test-view.phtml”/>