I'm using fos user bundle and pugx multi user bundle. I've read all the documentation and I'm new to Symfony. In the pugx multi user bundle there's a sample on every point but one: sucessful registration.
- Samples of overriding controllers for generating forms => ok
- Samples of overriding templates for generating forms => ok
- Samples of overriding successful registration sample => nothing.
Here's my code:
class RegistrationController extends BaseController
{
public function registerAction(Request $request)
{
$response = parent::registerAction($request);
return $response;
}
public function registerTeacherAction()
{
return $this->container
->get('pugx_multi_user.registration_manager')
->register('MyBundle\Entity\PersonTeacher');
}
public function registerStudentAction()
{
return $this->container
->get('pugx_multi_user.registration_manager')
->register('MyBundle\Entity\PersonStudent');
}
}
The problem is with ->get('pugx_multi_user.registration_manager')
which returns a manager. In the fos user overring controllers help, they get either a form
or a form.handler
. I'm having hard times to "link" those with the pugx_multi_user manager.
What code should I put in the registerTeacherAction()
to set roles for teacher, and in registerStudentAction()
to set roles for student on a successful registration?