Вот модель (стандартная)
Код: Выделить всё
<?php
namespace frontend\models;
use Yii;
use yii\db\ActiveRecord;
class editing_cards extends ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'editing_cards';
}
}
Код: Выделить всё
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
}
return $this->render('update', [
'model' => $model,
]);
}
Код: Выделить всё
public function actionUpdate($id)
{
$model = $this->findModel($id);
// if ($model->load(Yii::$app->request->post()) && $model->save()) {
// return $this->redirect(['view', 'id' => $model->id]);
// }
$model->TITLE= '1000';
$model->save();
return $this->render('update', [
'model' => $model,
]);
}