2015-08-17 38 views
0

中的新控制器時無法解析yii中的請求我創建了一個名爲CustomerOnBoarding的模塊。如果我把喜歡在調用模塊

本地主機/應用程序名稱/的index.php?R = CustomerOnBoarding

它調用其defaultcontroller和視圖的URL。而在另一方面,如果我創造我自己的控制器和視圖,並通過

本地主機/ yii_learn/index.php文件/ CustomerOnBoarding /測試/

那麼它不工作,並拋出一個錯誤叫它像

無法解析請求 「CustomerOnBoarding /測試/索引」

我也改變了urlmanager在配置的main.php文件 像:

'urlManager'=>array(
    'urlFormat'=>'path', 
    'rules'=>array('CustomerOnBoarding/Test/'=>'CustomerOnBoarding/Test/index'), 
), 

回答

0

你需要打電話給你新的控制器NewController行動new這樣的:

http://localhost/application_name/index.php?r=CustomerOnBoarding/NewController/new

+0

應該需要做修改的任何文件?正如我同樣我創建了TestController.php文件及其相應的視圖,然後我只需調用url http://localhost/yii_learn/index.php/?r = CustomerOnBoarding/Test / – user3381968