Advertisement
Guest User

Untitled

a guest
Jun 6th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. Variable "username" does not exist in HomeHomepageBundle:Template:header.html.twig
  2. at line 27
  3.  
  4. public function indexAction(Request $request)
  5. {
  6. $session = $this->getRequest()->getSession();
  7. $em = $this->getDoctrine()->getManager();
  8. $repository = $em->getRepository('LoginLoginBundle:Users');
  9.  
  10. if ($request->getMethod() == 'POST') {
  11. $session->clear();
  12. $username = $request->get('username');
  13. $password = sha1($request->get('password'));
  14. $user = $repository->findOneBy(array(
  15. 'username' => $username,
  16. 'password' => $password));
  17.  
  18. if ($user) {
  19.  
  20. return $this->render('HomeHomepageBundle:Content:Dashboard.html.twig', array(
  21.  
  22. 'username' => $user->getUsername() ,
  23. 'password' => $user->getPassword()));
  24.  
  25. } else {
  26. return $this->render('LoginLoginBundle:Default:index.html.twig', array('username' => 'Username or Password Incorrect'));
  27. $em->persist($user);
  28. $em->flush();
  29. }
  30. } else
  31. return $this->render('LoginLoginBundle:Default:index.html.twig');
  32.  
  33. <span data-brackets-id='1813' class="hidden-xs">{{ username }}</span>
  34.  
  35. {% include 'HomeHomepageBundle:Template:header.html.twig' %}
  36. {% include 'HomeHomepageBundle:Template:leftpanel.html.twig' %}
  37. </aside>
  38. <div data-bracets-id='1869' class="content-wrapper">
  39. {% block content %}{% endblock %}
  40. <section data-brackets-id='1878' class="content">
  41. </section>
  42. </div>
  43. {% include 'HomeHomepageBundle:Template:footer.html.twig' %}
  44. {% include 'HomeHomepageBundle:Template:rightpanel.html.twig' %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement