A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Hot answers tagged


You can use this: $block = $this->_layout->createBlock(\Vendor\Module\Block\Index::class); $block->setTemplate("Vendor_Module::index.phtml"); return $block; Where $this->_layout is the instance of \Magento\Framework\View\LayoutInterface


You should create a view model and inject it via DI. You can access the view model instance from within the template. customer_account_edit.xml: <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> &...


I have created module, Check the below files app/code/Vendor/Module/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_Module', __DIR__ ); app/code/Vendor/Module/etc/module.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3....


It can be override by adding the content / message in the en_US.csv file in the your custom theme. For reference check the row 120 in sitename/vendor/magento/module-review/i18n/en_US.csv.


In totals.phtml file :- /* @var \Magento\Sales\Block\Adminhtml\Order\Totals $block */ $order = $block->getOrder(); $rewardPoint = $order->getRewardPoint();

Only top voted, non community-wiki answers of a minimum length are eligible