title: Magento admin routing isn't working
body: <p>I'm working on a module for the admin area of Magento.  I'm trying to follow Alan Storm's tutorial on <a href="http://alanstorm.com/magento_admin_controllers" rel="nofollow noreferrer">Magento admin controllers</a> but can't seem to get my controller to do anything.  I think it may have something to do with routing, but I'm not sure.  It shows me the frontend template with a 404 error.</p>
  
  <p>(Note: <em>I have included all relevant code here.  The actual question is at the very bottom.</em>)</p>
  
  <p>The module is called Mynamespace_Donor and lives in app/code/local/Mynamespace/Donor/.</p>
  
  <p>My etc/config.xml looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
      &lt;modules&gt;
          &lt;Mynamespace_Donor&gt;
              &lt;version&gt;0.1.0&lt;/version&gt;
          &lt;/Mynamespace_Donor&gt;
      &lt;/modules&gt;
      &lt;global&gt;
          &lt;helpers&gt;
              &lt;donor&gt;
                  &lt;class&gt;Mynamespace_Donor_Helper&lt;/class&gt;
              &lt;/donor&gt;
          &lt;/helpers&gt;
          &lt;resources&gt;
              &lt;donor_setup&gt;
                  &lt;setup&gt;
                      &lt;module&gt;Mynamespace_Donor&lt;/module&gt;
                  &lt;/setup&gt;
              &lt;/donor_setup&gt;
          &lt;/resources&gt;
      &lt;/global&gt;
  
      &lt;admin&gt;
          &lt;routers&gt;
              &lt;donor&gt;
                  &lt;use&gt;admin&lt;/use&gt;
                  &lt;args&gt;
                      &lt;module&gt;Mynamespace_Donor&lt;/module&gt;
                      &lt;frontname&gt;donor&lt;/frontname&gt;
                  &lt;/args&gt;
              &lt;/donor&gt;
          &lt;/routers&gt;
      &lt;/admin&gt;
  
      &lt;adminhtml&gt;
          &lt;menu&gt;
              &lt;donor translate="title" module="donor"&gt;
                  &lt;title&gt;Donor&lt;/title&gt;
                  &lt;sort_order&gt;42&lt;/sort_order&gt;
                  &lt;children&gt;
                      &lt;manage_donors module="donor"&gt;
                          &lt;title&gt;Manage Donors&lt;/title&gt;
                          &lt;action&gt;donor/index/index&lt;/action&gt;
                      &lt;/manage_donors&gt;
                  &lt;/children&gt;
              &lt;/donor&gt;
          &lt;/menu&gt;
      &lt;/adminhtml&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>And my controllers/IndexController.php looks like this:</p>
  
  <pre><code>&lt;?php
  class Mynamespace_Donor_IndexController extends Mage_Adminhtml_Controller_Action
  {
      public function indexAction()
      {
          $this-&gt;loadLayout();
  
          //create a text block with the name of "example-block"
          $block = $this-&gt;getLayout()
          -&gt;createBlock('core/text', 'example-block')
          -&gt;setText('&lt;h1&gt;This is a text block&lt;/h1&gt;');
  
          $this-&gt;_addContent($block);
  
          $this-&gt;renderLayout();
      }
  }
  </code></pre>
  
  <p>The menu item points me to <code>/index.php/donor/index/index/key/e98a...</code> which shows a 404 page.  When I try to go directly to <code>/donor</code>, <code>/index.php/donor</code>, <code>/index.php/donor/index</code>, etc I still get 404 errors.</p>
  
  <p>If I remove the <code>&lt;helpers&gt;</code> from the config, Magento complains that it can't find it.  If I remove the <code>&lt;adminhtml&gt;</code> section, it stops complaining, even though I still have my <code>&lt;admin&gt;&lt;routers&gt;</code> section in there (don't know if the routing stuff needs a helper or if this is even relevant).</p>
  
  <p>I've also tried adding this block under <code>&lt;adminhtml&gt;</code>, but it when I try editing role permissions I get a white page with this error: <code>Fatal error: Class 'Mage_Mynamespace_Donor_Helper_Data' not found in /home/mysite/public_html/magento_dev_1_10/app/Mage.php on line 520</code></p>
  
  <pre><code>&lt;acl&gt;
      &lt;resources&gt;
          &lt;admin&gt;
              &lt;children&gt;
                  &lt;donor translate="title" module="Mynamespace_Donor"&gt;
                      &lt;title&gt;Donors&lt;/title&gt;
                      &lt;sort_order&gt;60&lt;/sort_order&gt;
                      &lt;children&gt;
                          &lt;manage_donors&gt;
                              &lt;title&gt;Manage Donors&lt;/title&gt;
                          &lt;/manage_donors&gt;
                      &lt;/children&gt;
                  &lt;/donor&gt;
              &lt;/children&gt;
          &lt;/admin&gt;
      &lt;/resources&gt;
  &lt;/acl&gt;
  </code></pre>
  
  <p><strong>Question:</strong> What am I doing wrong here?  Why can I not access this controller?</p>
  
  <p>And lastly, in Alan's sample code, the URL began with the module name, but I would like mine to start with <code>/admin/donor</code> instead of <code>/donor</code>. What changes do I need to make for this?</p>
  
  <hr>
  
  <p><strong>Edit 1</strong>
  The ultimate goal is to have a new tab in the admin area for managing Donors and related data in the system.  When you click on some menu item, I'd like to show a grid and have sub-tabs and stuff like that.  I'm <em>not</em> looking to override the adminhtml controller - although I am extending it per <a href="http://alanstorm.com/magento_admin_controllers" rel="nofollow noreferrer">Alan's suggestion</a>: </p>
  
  <blockquote>
    <p>The only difference from a standard
    controller here is that we’re
    extending
    Mage_Adminhtml_Controller_Action
    instead of
    Mage_Core_Controller_Varien_Action.
    Mage_Adminhtml_Controller_Action
    contains important code for validating
    the admin session, as well as several
    methods that are useful in an Admin
    Console context.</p>
  </blockquote>
  
  <p>So in this picture, clicking that first sub-menu item should call the Index action of my controller and show a grid or something to manage the Donors.</p>
  
  <p><img src="https://i.stack.imgur.com/Ia3GB.png" alt="The menu"></p>