public function actionZakazedit($id){
return $this->renderAjax('_zakazedit', ['model' => $model]);
}
<?php $this->registerJs('$("#edit").on("click", function(){
$.ajax({
url: 'Url::toRouter(["zakaz/zakazedit", "id" => "$model->id_zakaz"])',
success: function(html){
$(".view-zakaz").html(html);
}
})
});') ?>
Yii::$app->request->post()
. Я просто пробовал Yii::$app->request->post('data')
но у меня выходила ошибка return $this->redirect(['zakaz/admin', '#' => $id, 'click' => true]);
$model = $this->findModel(['id_zakaz' => $id]);
$model->active = 0;
$model->save();
return $this->registerJs('document.location.href = "http://crm/frontend/web/admin#"'.$id.'.click()');
protected function findModel($id)
{
if (($model = Notification::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}