title: Get parameter from a search form without any entity attached
body: <p>I am creating simple search form that will query and render data using Doctrine LIKE expression.I am confused how to get the parameter like this</p>
  
  <pre><code>$name = 'San Francisco China';
  </code></pre>
  
  <p>In the controller i created a simple form </p>
  
  <pre><code> public function searchAction(Request $request)
  {
      $data = array();
      $form= $this-&gt;createFormBuilder($data)
          -&gt;add('name_city', 'text', array(
              'label' =&gt; 'Search Here',
              'error_bubbling' =&gt; true,
          ))
          -&gt;add('search', 'submit')
          -&gt;getForm();
  
  
  
      if ($request-&gt;isMethod('POST')) {
          $form-&gt;handleRequest($request);
          $data = $form-&gt;getData();
      }
      $name = $request-&gt;request-&gt;get('name_city');//this confused me
      //$name = 'Beijing Angeles';//this will work
  
      $em = $this-&gt;getDoctrine()-&gt;getManager();
      $city = $em-&gt;getRepository('Bundle:City')-&gt;searchCity($name);
  
  
      return $this-&gt;render('Bundle:City:list.html.twig', array(
          'city' =&gt; $city, 
          'form'   =&gt; $form-&gt;createView(),
      ));
  }
  </code></pre>
  
  <p>In this case, the $name variable is passed to the searchCity method as the argument</p>
  
  <pre><code>public function searchCity($name)
  {
  
      return $this
          -&gt;createQueryBuilder('c')
          -&gt;select('c')
          -&gt;where('c.name LIKE :name_city')
          -&gt;setParameter('name_city', '%'.$name.'%')
         // -&gt;orderBy('v.dateCreated', 'DESC')
          -&gt;getQuery()
          -&gt;getResult()
      ;
  }
  </code></pre>
  
  <p>//list.twig</p>
  
  <pre><code>{% extends '::base.html.twig' %} 
  
  {% block body %}
    {{ form(form)}}
  
  {% for city in city %}
    {{ city }}
  {% endfor %}
  
  {% endblock %}
  </code></pre>
  
  <p>This will not work since all city name are displayed during page load. If i manually add a value to the $name, e.g $name = 'Beijing Washington', search works.Whats the correct way?</p>