Yii Modules and createUrl

4.3k views Asked by At

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

There are 1 answers

0
Neophile On BEST ANSWER

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');