1

There are two ways to set a blocks template. Either in the block using

$this->setTemplate('Vendor_Module::template.phtml');

or in layout

<block class="Vendor\Module\Block\BlockName" name="myblock"template="Vendor_Module::template.phtml"/>

Which way would be the best way to set a blocks template or what are the advantages/disadvantages of both?

Your Answer

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

Browse other questions tagged or ask your own question.