Foros del Web » Programando para Internet » PHP » Symfony »

The controller must return a response (null given). Did you forget to add a return st

Estas en el tema de The controller must return a response (null given). Did you forget to add a return st en el foro de Symfony en Foros del Web. Hola buenas, estoy empezando con symfony, estoy creando una aplicacion para llevar la gestion de software utilizado en la empresa. Tengo la siguiente funcion para ...
  #1 (permalink)  
Antiguo 27/04/2016, 11:07
 
Fecha de Ingreso: abril-2016
Mensajes: 6
Antigüedad: 8 años
Puntos: 0
The controller must return a response (null given). Did you forget to add a return st

Hola buenas, estoy empezando con symfony, estoy creando una aplicacion para llevar la gestion de software utilizado en la empresa.
Tengo la siguiente funcion para crear un nuevo Software:
public function crearAction()
{
$Software = new Software();
$Software->setnombre('CAMTASIA STUDIO');
$Software->setfechaCompra(new \DateTime());
$Software->setempresa('');
$Software->setdistribuidor('COMSOFT');
$Software->setfechaFinal(new \DateTime());
$Software->setimporte(376.67);
$Software->setimporteFinal(376.67);
$Software->setdepartamento('TITULACIONES-COMUNICACIÓN');
$Software->setobservaciones('A TRAVÉS DE FUNDACIÓN TRIPARTITA');
$Software->setinformacion('SI');
$Software->setentregado('SI');

$em = $this->getDoctrine()->getManager();
$em->persist($software);
$em->flush();

return $this->render('AppBundle:Software:Software.html.twig', array('software' => $software));
}


Y me sale el siguiente error:
The controller must return a response (null given). Did you forget to add a return statement somewhere in your controller?


Alguien me podría echar una mano? Se lo agradecería bastante.
Muchas gracias y un saludo!!
  #2 (permalink)  
Antiguo 27/04/2016, 11:42
Avatar de hhs
hhs
Colaborador
 
Fecha de Ingreso: junio-2013
Ubicación: México
Mensajes: 2.995
Antigüedad: 10 años, 9 meses
Puntos: 379
Respuesta: The controller must return a response (null given). Did you forget to add

Al parecer todo esta bien, estas seguro que se esta ejecutando ese método ?
__________________
Saludos
About me
Laraveles
A class should have only one reason to change.

Etiquetas: add, controller, null, response, return
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:26.