I want to provide different login/register pages/forms for my users, but the users are the same class. I don't want to populate the database with additional tables.
class RegistrationController extends Controller
{
/**
* @Route("/asd1", name="login1")
*/
public function registerUserAction()
{
return $this->container
->get('pugx_multi_user.registration_manager')
->register('AppBundle\Entity\SfGuardUser');
}
/**
* @Route("/asd2", name="login2")
*/
public function registerAdminAction()
{
return $this->container
->get('pugx_multi_user.registration_manager')
->register('AppBundle\Entity\SfGuardUser');
}
}
This configuration doesn't work unfortunately, mainly because UserDiscriminator takes values by class instead of user type names. For instance, to get the template, the discriminator does this
/**
*
* @return string
*/
public function getTemplate($name)
{
return $this->conf[$this->getClass()][$name]['template'];
}
Which will return it by AppBundle\Entity\SfGuardUser instead of normal or admins
Is there a way to have a single class for multiple types of users?
I want to provide different login/register pages/forms for my users, but the users are the same class. I don't want to populate the database with additional tables.
This configuration doesn't work unfortunately, mainly because UserDiscriminator takes values by class instead of user type names. For instance, to get the template, the discriminator does this
Which will return it by
AppBundle\Entity\SfGuardUser
instead ofnormal or admins
Is there a way to have a single class for multiple types of users?