вот такой экшн
$user = $this->model->get_user($id); $form = $this->getForm('edituser'); $is_submitted = $this->request->has('submit'); if ($is_submitted) { $user_info = $form->parse($this->request, $is_submitted); $errors = $form->validate($this, $user); if (!$errors){ $this->model->updateUser($user_info[id], $user_info); $this->redirectToAction('users'); } if ($errors){ cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error'); } } $template = cmsTemplate::getInstance(); 'form' => $form, 'errors' => $errors, 'user' => $user ));
public function check_user($user_id) { return $this->getItemByField('spusers', 'spec_id', $user_id); } public function updateUser($id, $user_info) { $this->filterEqual('id', $id); return $this->updateFiltered('spusers', $user_info); }
return $this->update('spusers', $id, $user_info);
$this->filterEqual('id', $id); return $this->updateFiltered('spusers', $user_info);