CController::createurl To Modules /Controllers


CHtml::listData($cities,'city.ID','city.name'),array('empty'=>'Select..','options'=>$catOpt, 'ajax' => array(

                    'type'=>'GET', //request type

                    'url'=>CController::createurl('common/modules/advancedsearch/PropertyAdvsearch/Location'),

                    //Yii::app()->createurl('common/modules/advancedsearch/PropertyAdvsearch/Location'), //url to call.

                    'update'=>'#droplocation',

                    'data'=>array('id'=>'js:this.value'))));

need something like this /not working, pretty sure is something realy stupid just a path error that im doind wrong

need to create a url to common/modules/advancedsearch/PropertyAdvsearch/Location in a dropdownlist so dont know if Yii::AP works on it but i try it and same error 404

CController::createurl(’/common/modules/advancedsearch/PropertyAdvsearch/Location’)

Whats your file structure?

Assume ‘common’ is a protected directory outside the webroot, where you have installed common modules components.

You will not reach the files there with a url.

The path common/modules/advancedsearch/PropertyAdvsearch/Location seems to be a file path, but not a url path.

Is advancedsearch your module, PropertyAdvsearch the controller, Location the action?

Means you have a AdvancedsarchModule with a controller PropertyadvsearchController (should be ucfirst) with a actionLocation?

  • Do you have a ‘common’ alias assigned with Yii::setPathOfAlias(‘common’, pathToCommon) in index.php?

  • Did you install the module ‘advancedsearch’ as class=‘common.advancedsearch.AdvancedsearchModule’

In this case and only in this case the url is


Yii::app()->creatUrl('advancedsearch/propertyadvsearch/location')

.

Yes ,you right, but that didnt work either even throw i "solve" this by sending my module controllers view and model to my "frontend", i still wanted to know how can i be in my frontend and call a module action that is in common cuz that didnt work might need in future again