【发布时间】:2012-09-11 11:01:42
【问题描述】:
这是我的激活文件, 在 app/etc/modules/My_Test.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<My_Test>
<active>true</active>
<codePool>local</codePool>
</My_Test>
</modules>
</config>
这是我在 app/code/local/MY/Test/etc/config.xml 中的配置文件
<?xml version="1.0" encoding="UTF-8"?>
<config>
<global>
<helpers>
<my_test>
<class>My_Test_Helper</class>
</my_test>
</helpers>
<models>
<mytest>
<class>My_Test_Model</class>
</my_test>
</models>
<blocks>
<my_test>
<class>My_Test_Block</class>
</my_test>
</blocks>
</global>
<frontend>
<routers>
<my_test>
<use>standard</use>
<args>
<module>My_Test</module>
<frontName>test</frontName>
</args>
</my_test>
</routers>
</frontend>
</config>
这是我的控制器代码 在 app/core/local/My/Test/controllers/IndexController.php
<?php
class My_Test_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
echo "This is the Module MyTest";
}
}
现在当我提供网址时 176.58.99.99/herbal/index.php/test/index/index 176.58.99.99/herbal/index.php/test/ 176.58.99.99/herbal/test/index/index 176.58.99.99/herbal/test/
显示 404 错误
【问题讨论】:
-
您是否知道模型部分中的开始标签和结束标签不同(
mytest与my_test),或者这只是复制/粘贴错误? -
另外你说你的文件在位置 MY/Test
-
上面的错字也会导致问题:)
标签: magento module controllers