4

How to call block without controller in phtml file for my custom module in magento2??

4

You can do this:

$blockObj= $block->getLayout()->createBlock('Magento\Catalog\Block\Product\View');

I'm not really sure if this is what you are after, your question is a little on the short side.

3

You can do this:

$blockObj= $this->getLayout()->createBlock('Magento\Catalog\Block\Product\View');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.