public function actionBlockUpdate() { $items = \Yii::$app->request->post('items'); $state = Block::updateOrder($items); if ($state) { $out = ['msg' => Yii::t('app', 'FLASH_SUCCESS_SAVE'), 'type' => 'success']; } else { $out = ['msg' => Yii::t('app', 'FLASH_ERROR_SAVE'), 'type' => 'danger']; } echo json_encode($out); \Yii::$app->end(); }