Admin Controller for load a Index Page in Magento

 

Admin Controller for load a Index Page in Magento

Hi Magento friend today's i'm share how we create a Admin Controller for load a Index Page in Magento

Here vendor name is Mageget

and module name is WebPushNotification

create a file in Index.php  in- Mageget\WebPushNotification\Controller\Adminhtml\Grid;


<?php

namespace Mageget\WebPushNotification\Controller\Adminhtml\Grid;

class Index extends \Magento\Backend\App\Action

{

    protected $_resultPageFactory;


    public function __construct(

        \Magento\Backend\App\Action\Context $context,

        \Magento\Framework\View\Result\PageFactory $resultPageFactory

    ) 

    {

        parent::__construct($context);

        $this->_resultPageFactory = $resultPageFactory;

    }

    public function execute()

    {

        $resultPage = $this->_resultPageFactory->create();

        $resultPage->setActiveMenu('Mageget_WebPushNotification::grid_list');

        $resultPage->getConfig()->getTitle()->prepend(__('Template List'));

        return $resultPage;

    }

   protected function _isAllowed()

    {

        return $this->_authorization->isAllowed('Mageget_WebPushNotification::grid_list');

    }

}






Deepak Kumar Bind

Success is peace of mind, which is a direct result of self-satisfaction in knowing you made the effort to become the best of which you are capable.

Post a Comment

If you liked this post please do not forget to leave a comment. Thanks

Previous Post Next Post