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:



Create the file:


STEP III – Create the backend controller action:

Create the folder:



Create the file:


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