【问题标题】:Unable to resolve the request in yii while calling new controller in module在模块中调用新控制器时无法解析 yii 中的请求
【发布时间】:2015-08-17 17:34:42
【问题描述】:

我创建了一个名为 CustomerOnBoarding 的模块。如果我调用像

这样的 url

localhost/application_name/index.php?r=CustomerOnBoarding

它正在调用它的默认控制器和视图。另一方面,如果我创建自己的控制器及其视图并通过

调用它

localhost/yii_learn/index.php/CustomerOnBoarding/Test/

然后它不工作并抛出像

这样的错误

无法解析请求“CustomerOnBoarding/Test/index”

我还在配置的 main.php 文件中更改了 urlmanager 喜欢:

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

【问题讨论】:

    标签: php yii


    【解决方案1】:

    你需要像这样调用你的新控制器NewController action new

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-02
    • 1970-01-01
    • 2018-08-10
    • 2015-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多