I want to ask about ztabularinput …
for actioncreate I’ve had success, but has not been successful for actionUpdate
actionUpdate.php
public function actionUpdate($id)
{
$model=$this->loadModel($id);
$studentManager = StudentManager::load($model);
//$studentManager=new studentManager();
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['ClassRoom']))
{
$model->attributes=$_POST['ClassRoom'];
$studentManager->manage($_POST['Student']);
if (!isset($_POST['noValidate']))
{
$valid=$model->validate();
$valid=$studentManager->validate($model) && $valid;
if($valid)
{
$model->save();
$studentManager->save($model);
$this->redirect(array('view','id'=>$model->id));
}
}
}
$this->render('create',array(
'model'=>$model,
'studentManager'=>$studentManager,
));
}
database that I created only:
class Room
-id
-name
student
-id
-name
-surname
-class_id
I got an error from the code load:
public static function load ($ model)
{
$ return = new StudentManager;
[b] foreach ($ model-> students as $ item) / / what the contents of the model-> students?[/b]
$ return-> _items [$ item-> primaryKey] = $ item;
return $ return;
}
realy need help…