public function createAction() { if ($this->request->isPost) { $input = $this->request->getPost(); if (isset($input->id) && !empty($input->id)) { $pidor = new Pidors(); foreach ($input as $key => $value) { if ($key !== 'id') { $pidor->{$key} = $value; } } if (!$pidor->save()) { $this->flash->error('Ошибка при сохранении'); } else { $this->flash->success('Депутат успешно добавлен'); } } else { $this->flash->error('Неверный формат данных'); } } else { $this->flash->error('Не переданы параметры'); } $this->forward('people/list'); }