I have gone through couple of tutorials to add custom module in Magento. I am not very familiar with Magento but I tried to follow the steps online. I am using Magento 1.7.0.2. So to add customer module I created folders as Mehul/Helloworld into app/core/local.
my Helloworld/etc/config.xml is,
<?xml version="1.0" encoding="UTF-8"?>
<!-- The root node for Magento module configuration -->
<config>
<!--
The module's node contains basic
information about each Magento module
-->
<modules>
<!--
This must exactly match the namespace and module's folder
names, with directory separators replaced by underscores
-->
<Mehul_Helloworld>
<!-- The version of our module, starting at 0.0.1 -->
<version>0.0.1</version>
</Mehul_Helloworld>
</modules>
<!-- This node contains parameters, available on frontend -->
<frontend>
<!-- Module aliases are located in this block -->
<routers>
<!-- This node's name should be the same as our alias -->
<helloworld>
<!-- use parameter specifies which of basic routers needs to be used.
This can be "standard" for frontend or "admin" for backend -->
<use>standard</use>
<!-- router arguments block -->
<args>
<!-- This parameter specifies the full name of out module -->
<module>Mehul_Helloworld</module>
<!-- This parameter sets module alias -->
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
</config>
my app/etc/Mehul_Helloworld.xml is,
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Mehul_Helloworld>
<!-- Whether our module is active: true or false -->
<active>true</active>
<!-- Which code pool to use: core, community or local -->
<codePool>local</codePool>
</Mehul_Helloworld>
</modules>
</config>
And my controller file 'IndexController.php' into Helloworld/controllers directory is,
<?php
class Mehul_Helloworld_IndexController extends Mage_Core_Controller_Front_Action {
public function indexAction()
{
echo "Hello tuts+ World";
}
public function testAction()
{
echo "test action";
}
}
?>
I disabled my all catch through admin panel and I flushed it too. I can see my module is enabled when i go to System/Configuration/Advance but I try to see my controller as,
mysite.com/helloworld/index/index and mysite.com/helloworld/index/test Then I am getting an 404 error message saying that Page Not Found!
What should I do now?
- Local
- Mehul
- Helloworld
- controllers
- IndexController.php
- etc
- config.xml
- controllers
- Helloworld
- Mehul
- etc
- Mehul_Helloworld.xml
localshould be inroot/app/codeand lowercased.etcshould be inappfolder too. Try to connect mysite.com/helloworld/ - P0ZiTR0N