donglu5612 2013-08-27 08:55
浏览 90
已采纳

Yii Modules和createUrl

I'm trying to set up an Ajax call function actionAjaxDialog within my Module's DefaultController.php

Originally, I didnt have this set up as a module so I had to convert it. Now that it's converted however it no longer works. I keep getting 404 not found errors and I've tried a few variations:

echo Yii::app()->createUrl('/firmtickets/DefaultController/AjaxDialog');
echo Yii::app()->createUrl('/DefaultController/AjaxDialog');
echo Yii::app()->createUrl('firmtickets/DefaultController/AjaxDialog');
echo Yii::app()->createUrl('DefaultController/actionAjaxDialog');
etc...

('firmtickets' being the module name)

Which create variations of:

http://localhost/clcms_yii/index.php?r=firmtickets/DefaultController/AjaxDialog

It's the first time I've ever made a Yii Module, so I'm assuming I'm doing something completely wrong

  • 写回答

1条回答 默认 最新

  • dsh7551 2013-08-27 09:13
    关注

    Only provide the controller name i.e "default"

    the name of the controller is "default" not "defaultController"

    try this

    echo Yii::app()->createUrl('/firmtickets/default/ajaxDialog');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作