0、在app/etc/modules下声明配置local中的Ym_hello 的模块
<?xml version="1.0"?>
<config>
<modules>
<Ym_hello >
<active>true</active>
<codePool>local</codePool>
</Ym_hello>
</modules>
</config>
1、app/code/local/下建个文件夹为包名(Ym)记得大写哦
2、app/code/local/包名/下建个文件夹为模块名(hello)
3、在模块下面建以下目录统一插件扩展目录包名下面可建立多个模块
app/code/local/包名/模块名/Block
app/code/local/Ym/hello/controllers
app/code/local/Ym/hello/etc
app/code/local/Ym/hello/Helper
app/code/local/Ym/hello/Model
app/code/local/Ym/hello/sql
4、在app/code/local/包名/模块名/etc下添加config.xml文件
<?xml version="1.0"?>
<config>
<modules>
<Ym_hello>
<version>0.1.0</version>
</Ym_hello>
</modules>
<frontend>
<routers>
<hello>
<use>index</use>
<args>
<module>Ym_hello</module>
<frontName>hell</frontName>
</args>
</hello>
</routers>
</frontend>
<config>
5、(先删除var/cache缓存)在后台检查是否可以看到插件模块已经显示,无显示则失败
6,在app/code/local/包名/模块名/controllers建立控制器
class Ym_hello_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction(){
echo 'Hello magento';
}
}
测试访问地址:http://域名/模块名(www.magento.com/模块名)