Hello,
I am trying to open a div with another content from other view. To be more clear I will paste the code.
This is the menu that have a few items:
echo '<li url='. Yii::app()->createAbsoluteUrl('service/services',array('id_service'=>$service->id_service) ).'>
<a href = "#">
<p>'.$service->service .'</p></a></li>';}
This is the function to call when the item is clicked.
$("#menu_service ul li").click(function () {
var url = $(this).attr(\'url\');
$(\'#open_services\').load(url);
This is the controller part:
public function actionServices($id_service)
{
$criteria = new CDbCriteria();
$criteria->condition = 'id_service = '.$id_service;
$service_model = Service::model()->findAll($criteria);
if($service_model===null)
throw new CHttpException(404,'The requested page does not exist.');
$this->renderPartial('services',array(
'model'=>$service_model,
));
}
This is the partial view that call the controller
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id_service',
'service',
'description',
),
)); ?>
for some reason is not rendering my page with the content sent from the controller. it appear blank and the data is not passed to the partial view. Any ideas ?