I've created custom extension in the admin panel under the menu of products. The problem is that I can't get the controller working. Code as fallows:
in etc/adminhtml/menu.xml:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="Vendor_Gift::Gift" title="Gifts" module="Vendor_Gift" parent="Magento_Catalog::inventory" action="gift/gift/" resource="Vendor_Gift::gift"/>
</menu>
</config>
-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="gift" frontName="gift">
<module name="Vendor_Gift" />
</route>
</router>
</config>
-in Vendor/Gift/Controller/Adminhtml/Gift/Index.php
<?php
namespace Vendor\Gift\Controller\Adminhtml\Gift;
class Index extends \Magento\Backend\App\Action
{
public function execute()
{
die('dd');
}
}
The generated link in the menu Gifts is: http://77.81.188.106/admin/gift/gift/index/key/bc29dbd2656f4c8c13599c4c63e1485afd9ffc3440fe4f9d9ceec8171b03d87a/
I just don't get where am I mistaken, is it in the menu link tab .. ?