29.07.2016

Magento 2. Magento Backend. Part I.

Registering a backend controller

STEP I – Remove the secret key:

 
For development purposes, it is recommended that we remove the secret key:

Stores | Configuration | Advanced | Admin | Security

Set Add Secret Key to URLs to No

STEP II – Create the backend route:

Create the folder:

app/code/Magedd/Education/etc/adminhtml

 

Create the file:

app/code/Magedd/Education/etc/adminhtml/routes.xml

STEP III – Create the backend controller action:

Create the folder:

app/code/Magedd/Education/Controller/Adminhtml/Index

 

Create the file:

app/code/Magedd/Education/Controller/Adminhtml/Index/Index.php

Make sure that your controller action extends from the \Magento\Backend\App\Action class. This will cover the access for authorized users.
 

STEP IV – Clean cache by CLI:

 
/var/www/local/{your-project-name.dev} >  php bin/magento cache:clean

 

To check the result navigate to the URL /admin/magedd/index