User creation - SamuelPouzet/auth GitHub Wiki
We purpose to create an user The form needed must implement SamuelPouzet\Auth\Interface\Form\UserFormInterface
We'll call it with the plugin
$form = $this->getForm(UserFormInterface::class);
if this form is valid, we'll call the service with the method createUser
$form = $this->getForm(UserFormInterface::class);
if ($this->request->isPost()) {
$form->setData($this->params()->fromPost());
if($form->isValid()) {
$this->userService->createUser($form->getData());
}
}
return new ViewModel(['form' => $form]);