I am trying to create an admin page for my extension.
I managed to add a new button to the side menu just below the System icon by adding the following menu.xml
under etc/adminhtml
.
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
<menu>
<add id="Test_Admin::adminpage" title="Test" module="Test_Admin" sortOrder="300" action="test/index" resource="Test_Admin::adminpage"/>
</menu>
</config>
But I can't figure out how to route this button to a new page, this page should contain a form among other html.
In addition what is the way to create db-configs for my extension for the user to edit.
Best Answer
So firstly you can add a link to your menu and specify the module and action. For example your module could have the following xml.
app/code/Stack/Example/etc/adminhtml/menu.xml
Now the action is split as follows:
So in our case we need the router
stack_example
defined in theadminhtml/routes.xml
Then the controller will be under
Stack/Example/Controller/Adminhtml/Content/Info.php
and should look as follows.