You should do a search for the user, then assign the values as the table fields, is an example.
$user = Users::findFirstById($id);
if (!$user) {
$this->flash->error("User was not found");
return $this->dispatcher->forward(array(
'action' => 'index'
));
}
if ($this->request->isPost()) {
$user->assign(array(
'name' => $this->request->getPost('name', 'striptags'),
'username' => $this->request->getPost('username', 'striptags'),
'email' => $this->request->getPost('email', 'email'),
'profilesId' => $this->request->getPost('profilesId', 'int'),
'active' => $this->request->getPost('active')
));
if (!$user->save()) {
$this->flash->error($user->getMessages());
} else {
$this->flash->success("User was updated successfully");
Tag::resetInput();
}
}
$this->view->user = $user;
$this->view->form = new UsersForm($user, array(
'edit' => true
));