- Имя просмотра: admin
- Название модели: Timesheet
< li>Имя контроллера: TimesheetController
ПРОСМОТР
МОДЕЛЬ
public function getInputField($fieldName, $row, $options = array()) {
return CActiveForm::textField($this, $fieldName,
array_merge(array("name" => "Timesheet[" . $row . "][" . $fieldName . "]"), $options)
);
}
КОНТРОЛЛЕР
public function actionEditableGrid() {
$model=new Timesheet('search');
$notenData = $model->search();
if (isset($_POST['Timesheet']) ) {
foreach( $notenData->data as $i=>$item ) {
if(isset($_POST['Timesheet'][$i])) {
$item->attributes=$_POST['Timesheet'][$i];
if ( $item->validate() ) {
$item->save();
}
}
}
$this->redirect(array('admin'));
}
}
Подробнее здесь: https://stackoverflow.com/questions/322 ... mit-button