I am working on a module for the Magento administration area. I am trying to follow Alan Storm's tutorial on Magento admin controllers, but cannot force my controller to do anything. I think this may be due to routing, but I'm not sure. It shows me an external template with a 404 error.
(Note: here I have included all the relevant code. The actual question is at the very bottom.)
The module is called Mynamespace_Donor and lives in app / code / local / Mynamespace / Donor /.
My etc / config.xml looks like this:
<?xml version="1.0"?>
<config>
<modules>
<Mynamespace_Donor>
<version>0.1.0</version>
</Mynamespace_Donor>
</modules>
<global>
<helpers>
<donor>
<class>Mynamespace_Donor_Helper</class>
</donor>
</helpers>
<resources>
<donor_setup>
<setup>
<module>Mynamespace_Donor</module>
</setup>
</donor_setup>
</resources>
</global>
<admin>
<routers>
<donor>
<use>admin</use>
<args>
<module>Mynamespace_Donor</module>
<frontname>donor</frontname>
</args>
</donor>
</routers>
</admin>
<adminhtml>
<menu>
<donor translate="title" module="donor">
<title>Donor</title>
<sort_order>42</sort_order>
<children>
<manage_donors module="donor">
<title>Manage Donors</title>
<action>donor/index/index</action>
</manage_donors>
</children>
</donor>
</menu>
</adminhtml>
</config>
And my /IndexController.php controllers look like this:
<?php
class Mynamespace_Donor_IndexController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
$this->loadLayout();
$block = $this->getLayout()
->createBlock('core/text', 'example-block')
->setText('<h1>This is a text block</h1>');
$this->_addContent($block);
$this->renderLayout();
}
}
/index.php/donor/index/index/key/e98a..., 404. /donor, /index.php/donor, /index.php/donor/index .., 404 .
<helpers> , Magento , . <adminhtml>, , <admin><routers> ( , ).
<adminhtml>, : 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
<acl>
<resources>
<admin>
<children>
<donor translate="title" module="Mynamespace_Donor">
<title>Donors</title>
<sort_order>60</sort_order>
<children>
<manage_donors>
<title>Manage Donors</title>
</manage_donors>
</children>
</donor>
</children>
</admin>
</resources>
</acl>
: ? ?
, , URL , , /admin/donor /donor. ?
1
. - , - . adminhtml, :
- Mage_Adminhtml_Controller_Action Mage_Core_Controller_Varien_Action. Mage_Adminhtml_Controller_Action , , Admin .
, , , -, .
