public function actionIndex() { $departments = Departments::getAll(); $searchModel = new Payments(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['departments' => $departments, 'dataProvider' => $dataProvider, 'searchModel' => $searchModel]); }
public function actionPutDepartments() { $data = Yii::$app->request->post(); Departments::setDepartments($data); $result = Departments::getAll(); print_r(json_encode($result)); return false; }