Hi all,
I am trying to create CRUD operations to a table with composite keys,
In my controller i have overridden the conventional set of functions to accept two parameters. The create action gets executed but my view, update and deletion functions from CGridview doesnt work.
in my Controller
In my admin.php i bind the current selected values to the URL as:-
What i get is :
I used the debugger and it gives a similar error. As far as i can understand the way i have called the action from URL is correct, have i missed something?
Any help to this right is greatly appreciated, Thanks for your time!
Cheerz!
I am trying to create CRUD operations to a table with composite keys,
In my controller i have overridden the conventional set of functions to accept two parameters. The create action gets executed but my view, update and deletion functions from CGridview doesnt work.
in my Controller
public function actionView($subjectName, $teacher_id) { $model=$this->loadModel($subjectName, $teacher_id); $this->render('view',array('model'=>$model)); } public function loadModel($subjectName, $teacher_id) { $model= Teacherteachsub::model()->findByPk(array('subjectName'=>$subjectName, 'subjectTeacherId'=>$teacher_id)); if($model==null) throw new CHttpException(404,'The requested page does not exist.'); return $model; }
In my admin.php i bind the current selected values to the URL as:-
<?php $this->widget('zii.widgets.grid.CGridView', array( 'id' => 'resultgrid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array( 'subjectName', 'subjectTeacherId', array( 'class' => 'CButtonColumn', 'template' => '{view}{update}{delete}', 'buttons' => array ( 'view' => array ( 'url' => 'Yii::app()->createUrl("teacherteachsub/view/",array("subjectName"=>$data->subjectName, "subjectTeacherId"=>$data->subjectTeacherId))', ), ), ), ), )); ?>
What i get is :
Quote
Error 400 Your request is invalid.
I used the debugger and it gives a similar error. As far as i can understand the way i have called the action from URL is correct, have i missed something?
Any help to this right is greatly appreciated, Thanks for your time!
Cheerz!
