public function actionEdit() { $id = \Yii::$app->request->get('id'); $page = Contacts::find()->andWhere(['id' => $id])->one(); $form = \Yii::$app->request->post('Contacts'); if ($form) { $page->email = $form['email']; $page->phone = $form['phone']; $page->adress = $form['adress']; $page->map_long = $form['map_long']; $page->map_lat = $form['map_lat']; $page->save(); } return $this->render('edit', ['item' => $page]); }
public function actionContacts() { return $this->render('contact', ['page' => Contacts::find()->where(['id' => 1])->one(), 'subjects' => ContactsSubjects::find()->all()]); }