title: The controller must return a response (null given). Did you forget to add a return statement somewhere in your controller? please
body: <pre><code>**DefaultController.php**
  </code></pre>
  <p>This is my DefaultController.php file i am going to simple login page in symfony
  i want to display hello with name which i mentioned in controller, plese guide me i am new in symfony.</p>
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace AppBundle\Controller;
  use AppBundle\Entity\users;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\HttpFoundation\Request;
  use Symfony\Component\HttpFoundation\RedirectResponse;
  use Symfony\Component\HttpFoundation\Response;
  
  
  class DefaultController extends Controller
  {
    /**
     * @Route(&quot;/login&quot;, name=&quot;login&quot;)
     */
    public function loginAction(Request $request)
      {
      
      if($request-&gt;getMethod()=='POST'){
        $username=$request-&gt;get('username');
        $password=$request-&gt;get('password');
        $em=$this-&gt;getDoctrine()-&gt;getEntityManager();
        $repository=$em-&gt;getRepository('AppBundle:users');
        $user=$repository-&gt;findOneBy(array('userName'=&gt;$username, 'password'=&gt;$password)); 
      
        if($user)
        {
            return $this-&gt;render('default/login.html.twig', array('name' =&gt;$user-&gt;getFirstName()));
        }
      }
      else{
        return $this-&gt;render('default/login.html.twig');
      }
    }
  }
  </code></pre>
  <p><strong>login.html.twig</strong></p>
  <p>This is my login page in symfony,  want to display hello with name which i mentioned in <strong>Hello {{name}}</strong> this line, please do some correction if needed.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
    &lt;head&gt;
      {% block stylesheets %}
        &lt;link rel=&quot;stylesheet&quot; href=&quot;{{ asset('templates/css/1.css') }}&quot;&gt;
      {% endblock %}
    &lt;/head&gt;
    &lt;body&gt;  
      
      {% block container %}
      
        &lt;div class=&quot;wrapper&quot;&gt;
          &lt;h2&gt;Login User&lt;/h2&gt;                    
          &lt;form class=&quot;form-sigin&quot; method=&quot;POST&quot; action=&quot;{{path('login')}}&quot;&gt;
            &lt;div&gt;&lt;input type=&quot;text&quot; name=&quot;user_name&quot; class=&quot;txtbox&quot; placeholder=&quot;User Name&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;input type=&quot;password&quot; name=&quot;password&quot; class=&quot;txtbox&quot; placeholder=&quot;Password&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;input type=&quot;checkbox&quot;&gt;&lt;span&gt;Remember&lt;/span&gt;&lt;/div&gt;
            &lt;div&gt;&lt;input type=&quot;submit&quot; value=&quot;Log In&quot; class=&quot;loginBtn&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;span&gt;&lt;a href=&quot;&quot;&gt;Forgot Password&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
          &lt;/form&gt;
        &lt;/div&gt;
        {% if name is defined  %}
          &lt;div class=&quot;alert-info fade in&quot;&gt;
            &lt;strong&gt;Hello {{name}}&lt;/strong&gt;
          &lt;/div&gt;
        {% endif  %}
  
      {% endblock %}  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p><strong>users.php</strong></p>
  <pre class="lang-php prettyprint-override"><code>&lt;?php
      
  namespace AppBundle\Entity;
      
  use Doctrine\ORM\Mapping as ORM;
      
  /**
   * users
   *
   * @ORM\Table(name=&quot;users&quot;)
   * @ORM\Entity(repositoryClass=&quot;AppBundle\Repository\usersRepository&quot;)
   */
  class users
  {
      /**
       * @var int
       *
       * @ORM\Column(name=&quot;id&quot;, type=&quot;integer&quot;)
       * @ORM\Id
       * @ORM\GeneratedValue(strategy=&quot;AUTO&quot;)
       */
      private $id;
  
      /**
       * @var string
       *
       * @ORM\Column(name=&quot;user_name&quot;, type=&quot;string&quot;, length=255)
       */
      private $userName;
     
      /**
       * @var string
       *
       * @ORM\Column(name=&quot;first_name&quot;, type=&quot;string&quot;, length=255)
       */
      private $firstName;
      
      /**
       * @var string
       *
       * @ORM\Column(name=&quot;password&quot;, type=&quot;string&quot;, length=255)
       */
      private $password;
      
      /**
       * Get id
       *
       * @return int
       */
      public function getId()
      {
          return $this-&gt;id;
      }
      
      /**
       * Set userName
       *
       * @param string $userName
       *
       * @return users
       */
      public function setUserName($userName)
      {
          $this-&gt;userName = $userName;
    
          return $this;
      }
      
      /**
       * Get userName
       *
       * @return string
       */
      public function getUserName()
      {
          return $this-&gt;userName;
      }
      
      /**
       * Set firstName
       *
       * @param string $firstName
       *
       * @return users
       */
      public function setFirstName($firstName)
      {
          $this-&gt;firstName = $firstName;
  
          return $this;
      }
      
      /**
       * Get firstName
       *
       * @return string
       */
      public function getFirstName()
      {
          return $this-&gt;firstName;
      }
    
      /**
       * Set password
       *
       * @param string $password
       *
       * @return users
       */
      public function setPassword($password)
      {
          $this-&gt;password = $password;
      
          return $this;
      }
      
      /**
       * Get password
       *
       * @return string
       */
      public function getPassword()
      {
          return $this-&gt;password;
      }
  }
  </code></pre>