我正在制作一个启用的Magento模块,我的缓存已关闭.
使用本教程... http://www.pierrefay.com/magento-create-controller-36
这是我被要求使用的控制器app/code/local/Pfay/Test
.
class Pfay_Test_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction ()
{
echo 'test index';
}
public function mamethodeAction ()
{
echo 'test mymethod';
}
}
Run Code Online (Sandbox Code Playgroud)
然而,当我进入magento/Pfay/Test/index
我的网络浏览器时,我得到一个404页面,而不是控制器.
在您复制和粘贴的示例代码中,Pfay_All.xml文件中的以下标记之间有空格:
<active> true </active>
<codePool> local </codePool>
Run Code Online (Sandbox Code Playgroud)
删除这些空格,使标签看起来像这样:
<active>true</active>
<codePool>local</codePool>
Run Code Online (Sandbox Code Playgroud)
此外,您使用的路径应该是/test/index
或/test
不是/Test/index
- 即在测试中没有大写T.