Hoping someone could help me out with a test Magento custom module that I'm having no luck getting to output. The module shows up in Configuration > Advanced, so I assumed the Helloworld_Mystuff.xml was done properly but I could be wrong! I disabled all cache on my local Magento admin instance. Flushed the cache a number of times, logged in/out of admin, differ browsers. I'm on a Mac using apache if it matters.
/etc/modules/Helloworld_Mystuff.xml (excluded the xml line)
<config>
<modules>
<Helloworld_Mystuff>
<active>true</active>
<codePool>local</codePool>
</Helloworld_Mystuff>
</modules>
</config>
/app/code/local/Helloworld/Mystuff/controllers/IndexController.php
class Helloworld_Mystuff_IndexController extends Mage_Core_Controller_Front_Action{
public function indexAction(){
echo "test";
//$this->loadLayout()->renderLayout();
}
}
/app/code/local/Helloworld/Mystuff/etc/config.xml
<config>
<modules>
<Helloworld_Mystuff>
<version>0.0.1</version>
</Helloworld_Mystuff>
</modules>
<frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>Helloworld_Mystuff</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
</config>
Tried doing
- /helloworld/index
- /helloworld/index/index
and it resulted in a 404 error.
I tried putting some debug code in the /varien/Router/Standard.php to see which class it was looking for when I called my test URL, and it was looking for Mage_Cms_IndexController. So somewhere along the lines my custom module is not loading because Magento doesn't even attempt to load the file.
EDIT: I added some additional debug code in the Varien/Router/Standard.php within the function:
public function match(Zend_Controller_Request_Http $request)
{
//checking before even try to find out that current module
//should use this router
if (!$this->_beforeModuleMatch()) {
return false;
}
$this->fetchDefault();
$front = $this->getFront();
$path = trim($request->getPathInfo(), '/');
if ($path) {
$p = explode('/', $path);
} else {
$p = explode('/', $this->_getDefaultPath());
}
echo "<br />front = " . ($front);
echo "<br />path = " . ($path);
echo "<br />request->getModuleName = ".$request->getModuleName();
Output
front =
path = helloworld/index
request->getModuleName =
front =
path = helloworld/index
request->getModuleName =
front =
path = helloworld/index
request->getModuleName = cms
front =
path = helloworld/index
request->getModuleName = cms