2016-03-02 53 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

相關問題