【发布时间】:2016-03-02 10:27:33
【问题描述】:
我正在尝试在本地创建新模块。现在模块正在检测名称为IndexController.php。该控制器由 indexAction 和 testAction 两个功能组成。
现在 testAction 未检测到,但 indexAction 已检测到。
我正在使用此链接运行控制器localhost/magentoproject/index.php/test/index,它按预期运行
但是当我尝试运行 localhost/magentoproject/index.php/test/test 时显示 404 未找到。
这是结构 indexController.php
class Pfay_Test_IndexController extends Mage_Core_Controller_Front_Action {
public function IndexAction() {
$this->loadLayout();
$this->renderLayout();
//echo 'test index';
}
public function testAction() {
echo 'test mymethod';
}
}
this is when im run localhost/magentoproject/index.php/test/index
this is when im run localhost/magentoproject/index.php/test/test
【问题讨论】:
-
在
echo 'test mymethod';之后尝试die()
标签: php magento controller