[英]Unable to resolve the request in yii while calling new controller in module
我創建了一個名為CustomerOnBoarding的模塊。 如果我像這樣的網址
本地主機/application_name/index.php?r=CustomerOnBoarding
它正在調用其defaultcontroller和視圖。 另一方面,如果我創建自己的控制器及其視圖並通過調用
本地主機/yii_learn/index.php/CustomerOnBoarding/Test/
那么它就不起作用,並拋出類似的錯誤
無法解決請求“ CustomerOnBoarding / Test / index”
我還更改了配置的main.php文件中的urlmanager,例如:
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array('CustomerOnBoarding/Test/'=>'CustomerOnBoarding/Test/index'),
),
你需要打電話給你的新控制器NewController
動作new
是這樣的:
http://localhost/application_name/index.php?r=CustomerOnBoarding/NewController/new
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.