In this post I am going to explain how to to call template block in phtml file or how to use phtml file in another phtml file.

Sometimes you want to get content from another phtml file without defining in layout. In this case, we can use a method called toHtml of a block.

Suppose that we have a phtml file called mytemplate.phtml of module Ht_Mymodule. So, we can do it by below code.

If you want to use Magento 2 default template block then you can do it as below.

Thats it. Enjoy Magento 2!!