You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Fatal error: Class 'Kyna\UserBundle\Validator\UsernameValidator' not found in C:\wamp\www\Project_V1\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory.php on line 68
I have extand the original controller and the namespace is not correct: Kyna\UserBundle\Validator\UsernameValidator, "Kyna\UserBundle" is not correct, it's my namespace and not FosUserBundle namespace.
My registration controller (inspired by example in documentation):
<?php
namespace Kyna\UserBundle\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use FOS\UserBundle\Controller\RegistrationController as BaseController;
class RegistrationController extends BaseController
{
public function registerAction()
{
$form = $this->container->get('fos_user.registration.form');
$formHandler = $this->container->get('fos_user.registration.form.handler');
$confirmationEnabled = $this->container->getParameter('fos_user.registration.confirmation.enabled');
$process = $formHandler->process($confirmationEnabled);
if ($process) {
$user = $form->getData();
/*****************************************************
* Add new functionality (e.g. log the registration) *
*****************************************************/
$this->container->get('logger')->info(
sprintf('New user registration: %s', $user)
);
if ($confirmationEnabled) {
$this->container->get('session')->set('fos_user_send_confirmation_email/email', $user->getEmail());
$route = 'fos_user_registration_check_email';
} else {
$this->authenticateUser($user);
$route = 'fos_user_registration_confirmed';
}
$this->setFlash('fos_user_success', 'registration.flash.user_created');
$url = $this->container->get('router')->generate($route);
return new RedirectResponse($url);
}
return $this->container->get('templating')->renderResponse('FOSUserBundle:Registration:register.html.'.$this->getEngine(), array(
'form' => $form->createView(),
));
}
}
Can you help me please ? Thanks :)
ps: sorry for my english, I am french.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello, on registration, I have this error:
Fatal error: Class 'Kyna\UserBundle\Validator\UsernameValidator' not found in C:\wamp\www\Project_V1\Symfony\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory.php on line 68
ErrorTracer: http://i.imgur.com/mi38NkD.jpg
I have extand the original controller and the namespace is not correct: Kyna\UserBundle\Validator\UsernameValidator, "Kyna\UserBundle" is not correct, it's my namespace and not FosUserBundle namespace.
My registration controller (inspired by example in documentation):
<?php
Can you help me please ? Thanks :)
ps: sorry for my english, I am french.
The text was updated successfully, but these errors were encountered: