I have created custom admin menu but when clicking on the menu it is redirecting to dashboard.
Here is the xml within etc/adminhtml/menu.xml
:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="Cubet_RMA::rma" title="Cubet RMA" resource="Cubet_RMA::rma" module="Cubet_RMA" sortOrder="20"/>
<add id="Cubet_RMA::managerma" title="Manage RMA" resource="Cubet_RMA::Rmaadmin" parent="Cubet_RMA::rma" action="rmaadmin/rmaadmin/index" module="Cubet_RMA" sortOrder="20"/>
</menu>
</config>
Here is the xml within etc/adminhtml/routes.xml
:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="admin">
<route id="rmaadmin" frontName="rmaadmin">
<module name="Cubet_RMA"/>
</route>
</router>
</config>
Here is the Controller/Adminhtml/Rmaadmin/Index.php
code:
<?php
namespace Cubet\RMA\Controller\Adminhtml\Rmaadmin;
class Index extends \Magento\Backend\App\Action
{
const ADMIN_RESOURCE = 'ListReturns';
protected $resultPageFactory;
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory)
{
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
}
public function execute()
{
$return = $this->resultPageFactory->create();
// $return->setActiveMenu('Cubet_RMA::rma');
// $return->getConfig()->getTitle()->prepend((__('Manage RMA Requests')));
return $return;
}
}
Please help me on this.