title: Return array from symfony 2 controller action
body: <pre><code>I need to return $items array from 'http://localhost:8000/cart/viewall'
  controller action. But all i get is this error.
  </code></pre>
  
  <blockquote>
    <p>The Response content must be a string or object implementing __toString(), "array" given. </p>
  </blockquote>
  
  <p>This is my code,</p>
  
  <pre><code> /**
   * @Route("/cart/viewall")
   * @Template()
   */
  public function viewallAction() {
      $items = array(1 =&gt; 'item 1', 2 =&gt; 'item 2');        
      return new Response($items);
  }     
  </code></pre>
  
  <p>It would be great help if someone can supply a solution.</p>