The controller must return a response

symfony

Solution

The controller must return a `Symfony\Component\HttpFoundation\Response` instance, so you should have:

use Symfony\Component\HttpFoundation\Response;

instead of

use Symfony\Component\BrowserKit\Response;

Problem

I am new with Symfony 2.. I try something really basic.. I have just created a bundle with the command line et put this in my controller : ``` use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\BrowserKit\Response; class DefaultController extends Controller { public function indexAction($name) { return new Response('<html><body>Hello '.$name.'!</body></html>'); } } ``` and I have a logicException with "the controler must return a response" this is not what I am doing here ? Thank u PS : I add the routing.yml in app ``` acme_hello: resource: "@AcmeHelloBundle/Resources/config/routing.yml" prefix: / ``` routing.yml in Resources ``` acme_hello_homepage: pattern: /hello/{name} defaults: { _controller: AcmeHelloBundle:Default:index } ```

Original source