Here am added a admin controller, here is my code
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="standard">
<route frontName="my_orders" id="my_orders">
<module name="My_Orders" before='Magento_Backend'/>
</route>
</router>
</config>
Here is the controller file
My/Orders/Controller/Adminhtml/Index/Index.php
<?php
namespace My\Orders\Controller\Adminhtml\Index;
class Index extends \Magento\Backend\App\Action
{
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\Registry $coreRegistry,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
) {
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context, $coreRegistry);
}
public function execute()
{
$result = $this->resultPageFactory->create(ResultFactory::TYPE_RAW);
echo "save contoller";
}
protected function _isAllowed()
{
return true;
}
}
?>
When I try to access the Controller its giving Error:404
Url path is
http://magentowebsite.co/admin/my_orders/index/index
Where am doing wrong. Can I get help? Thank you in advance.
http://magentowebsite.co/admin/my_orders/index/
still itsError: 404