Mage Check Facebook icon Mage Check Linkedin icon

Magento How to create a Backend Controller

$ This Controller will add a new tab in Magento 1 Admin with custom option. In this example, we will do the basics, and we will create a simple new tab called MageCheck with two options.

$ We will do the same for Magento 2 and create a Backend Controller for Magento 2 Admin.

$ Let's follow the steps below!

Step 1: Install Module\Extension

Install the module from initial page

Step 2: Declare Controller

Magento 1 (2007 - 2014)

File path: app/code/local/MageCheck/Tutorial/etc/config.xml


        
    

Magento 2 Open Source (2014 -)

File path: app/code/MageCheck/Tutorial/etc/adminhtml/routes.xml


        
    

Step 3: Create Controller Function

Magento 1 (2007 - 2014)

File path: app/code/local/MageCheck/CreateAdminController/controllers/Adminhtml/IndexController.php


        
        

File path: app/code/MageCheck/Tutorial/Helper/Data.php


        
    

Magento 2 Open Source (2014 -)

File path: app/code/MageCheck/Tutorial/Controller/Adminhtml/Index/Index.php


        
    

Step 4: Create Menu Options

Magento 1 (2007 - 2014)

File path: app/code/local/MageCheck/CreateAdminController/etc/adminhtml.xml


        
    

Magento 2 Open Source (2014 -)

File path: app/code/MageCheck/Tutorial/etc/adminhtml/menu.xml


        
    

Step 5: Git Sources

Magento 1 (2007 - 2014)

URL: https://bitbucket.org/magecheck/magento1945/src/create-backend-controller/

git clone -b create-backend-controller git@bitbucket.org:magecheck/magento1945.git

Magento 2 Open Source (2014 -)

URL:

Will be added further

Step 6: Test

Notice
Go to the admin and click on the new menu points and it will redirect you to the echo's in this documentation
Custom
This is the sample way to create a Backend Controller in Magento!
Quote