Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8325949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:36:27+00:00 2026-06-09T00:36:27+00:00

I’m currently working on a custom module for Magento. I understand the basics of

  • 0

I’m currently working on a custom module for Magento. I understand the basics of Packages, Modules and Routers, and I have built the front end part of my module.

However I am now moving on to the admin side of things. However I’m a little bit confused by how I add the admin part to my routers and get it to call the relevant controller.

Let’s imagine I have created these routers…

<frontend>
    <routers>
        <slider>
            <use>standard</use>
            <args>
                <module>Mypackage_Myodule</module>
                <frontName>Mymodule</frontName>
            </args>
        </slider>
    </routers> 
</frontend> 
<admin>
    <routers>
        <mymoduleadmin>
            <use>admin</use>
            <args>
                <module>Mypackage_Myodule</module>
                <frontName>Mymodule</frontName>
            </args>
        </mymoduleadmin>
    </routers>
</admin>

I presume that both these routers will attempt to call controllers/IndexController.php and therefore the same functionality? Is it possible to set things up so my routers call different controllers depending on whether they are front end or admin? Is this even possible or do I need to set up a front end module and an admin module?

I apologise if this is a School Boy question, but this has me a bit confused and in reality I just want to know the most efficient way to set up a custom module with front end and admin functionality.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:36:30+00:00Added an answer on June 9, 2026 at 12:36 am

    Depending upon the area(frontend or adminhtml), frontend or adminhtml router are dispatched.
    So you need not need to worry about getting it messed up as long as you are using different controller files for frontend and adminhtml, frontend controller extending from Mage_Core_Controller_Front_Action & adminhtml extending from Mage_Adminhtml_Controller_Action.

    Frontend / Adminhtml routers can be defined as (just a syntax):

    <frontend>
        <routers>
            <[module]>
                <use>standard</use>
                <args>
                    <module>[Namespace]_[Module]</module>
                    <frontName>[module]</frontName>
                </args>
            </[module]>
        </routers>
    </frontend>
    <admin>
        <routers>
            <[module]>
                <use>admin</use>
                <args>
                    <module>[Namespace]_[Module]</module>
                    <frontName>[module]</frontName>
                </args>
            </[module]>
        </routers>
    </admin>
    

    And you can create frontend controllers under: app/code/[codePool]/[Namespace]/[Module]/controllers/

    For example:

    <?php
    //file: app/code/local/MagePsycho/Testmodule/controllers/IndexController.php
    class MagePsycho_Testmodule_IndexController extends Mage_Core_Controller_Front_Action
    {
        public function indexAction(){
    
        }
    }
    

    In order to access it from url: http://your-magento-url/testmodule/index/index
    and adminhtml controllers under:
    app/code/[codePool]/[Namespace]/[Module]/controllers/Adminhtml/

    For example:

    <?php
    //file: app/code/local/MagePsycho/Testmodule/controllers/Adminhtml/IndexController.php
    class MagePsycho_Testmodule_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
    {
        public function indexAction(){
    
        }
    }
    

    In order to access it from url: http://your-magento-url/testmodule/adminhtml_index/index
    (You can see the Adminhtml folder for separating adminhtml controllers)

    Hope this gave you some info.
    Thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.