В чем может быть проблема?
Controller:
Код: Выделить всё
public function actionJobup($id)
{
$model = $this->findLetter($id);
$model->user_id = Yii::$app->user->identity->id;
$model->save();
Yii::$app->session->setFlash('success', "Корреспонденция принята в работу");
return $this->redirect(['view', 'id' => $model->id]);
}
protected function findLetter($id)
{
if (($model = Letters::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
Код: Выделить всё
<?= Html::a('Принять в работу', ['jobup', 'id' => $model->id], [
'class' => 'btn btn-primary',
'data' => [
'method' => 'post',
],
]) ?>