Symfony2 expects a Response object to be returned from a controller action. I assume that you probably want something like the following:
return $this->render(
"YourBundlePath:Something:template.html.twig",
array(
'curso' => $curso,
'delete_form' => $deleteForm->createView(),
'detcurso' => $detcurso,
'formdetcurso' => $formdetcurso,
)
);
The method $this->render()will display the provided template name, and in the above example, pass the template to your array of parameters. It will wrap this generated content in a Response object, which is what Symfony2 expects.
You can also return a new Response object directly, for example return new Response('Hello, world'), if necessary.
. .