2016-03-02 28 views
1

即时通讯尝试在本地创建新模块。现在该模块被检测到,其名称为IndexController.php。该控制器由两个功能组成,即indexAction和testAction。 现在testAction未被检测到,但indexAction被检测到。 即时通讯使用此链接运行控制器localhost/magentoproject/index.php/test/index这是按预期方式运行 但当我尝试运行localhost/magentoproject/index.php/test/test是显示404未找到。如何在magento中的相同控制器中使用其他功能?

这是结构 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

+0

尝试与地方'模具()''后回声 '测试的MyMethod';' – urfusion

回答

0

路径将moduelname/controllername/actionmethod在你的情况下,模块名称将是test控制器名称将是index和行动方法将为test

所以URL将被localhost/magentoproject/index.php/test/index/test

+0

感谢凯萨尔。是工作 – Zam

相关问题