Witam mam taki kod
public function login(Request $request)
{
$form = $this->createFormBuilder()
->add('username', TextType::class)
->add('password', PasswordType::class)
->getForm();
$form->handleRequest($request);
if($form->isValid() && $form->isSubmitted()) {
$username = $form['username']->getData();
$password = $form['password']->getData();
$user = $this->getDoctrine()->getRepository('AccountBundle:User')
->findOneBy(array('username' => $username, 'password' => $password));
if ($user) {
return $this->render('AccountBundle:UserManager:login_success.html.twig', ['user' => $user]);
}
}
return $this->render('AccountBundle:UserManager:login.html.twig', array(
'form' => $form->createView()
));
}
Czy ktos mogl by powiedziec co robie tutaj zle?
bo logowanie niestety nie dziala