New answers tagged

0

I have updated your form.php file, Check the below code. <?php namespace Vendor\Module\Block\Adminhtml\Blog\Edit; use Magento\Backend\Block\Template\Context; use Magento\Framework\Registry; use Magento\Framework\Data\FormFactory; use Vendor\Module\Block\Adminhtml\Status; class Form extends \Magento\Backend\Block\Widget\Form\Generic { /** * @...


2

Please use this <?php echo $block->getLayout()->createBlock("Magento\Framework\View\Element\Template")->setTemplate('Vendor_Module::test.phtml')->toHtml(); ?>


1

For Ex. if you call helper function from controller, then you can call PHTML and get data using following way : /app/code/Vendor/Module/Controller/Index/Index.php <?php namespace Vendor\Module\Controller\Index; class Index extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Framework\App\Request\Http */ protected $...


0

You can try, <?php echo $block->getLayout()->createBlock("Magento\Framework\View\Element\Template")->setTemplate('Vendor_Module::test.phtml')->toHtml(); ?>


0

OPCache was enabled and caching the data. service php7.3-fpm restart And everything is good :)


0

Here I achieved this line by using below line, If you have the same requirement you can use this line of code. <move element="breadcrumbs" destination="main.content" before="-"/> I hope it may help you. find the reference image below.


3

you can use $this->getRequest()->getParam('p') to get page number. Either you are in .phtml or in controller this will work If it is not working for you then you can try this: protected $request; public function __construct( \Magento\Framework\App\Request\Http $request, ....//rest of parameters here ) { $this->request = $request; ......


2

Create a new module Your_Module - a simple way to do this is with n98-magerun2 n98-magerun2.phar dev:module:create Add a new block class in Your/Module/Block, eg - Category.php <?php namespace Your\Module\Block; use Magento\Framework\View\Element\Template\Context; use Magento\Framework\Registry; use Magento\Catalog\Model\CategoryFactory; class ...


Top 50 recent answers are included