Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/06/2012, 07:44
Avatar de ONahuelO
ONahuelO
 
Fecha de Ingreso: junio-2009
Ubicación: Gualeguaychú, Argentina
Mensajes: 144
Antigüedad: 14 años, 10 meses
Puntos: 4
Respuesta: Field de formulario symfony2

Hola, llegue a poder mostrarlo al field, y lo valida bien, pero a la hora de poder procesar ese valor me tira el siguiente error:

Código:
An exception has been thrown during the rendering of a template ("Catchable Fatal Error: Object of class DeGualeguaychu\AvisosBundle\Entity\Categorias could not be converted to string in C:\www\app\cache\dev\twig\90\51\3a6e960dcce4781fb3125a999a79.php line 379") in DeGualeguaychuAvisosBundle:Default:nuevo.html.twig at line 323

nuevo.html.twig
Código:
323        {{ get }}
324        <br>
325        <form action="{{ path('nuevo') }}" method="post">
326            {{ form_widget(form) }}
327            <input type="submit" value="Publicar Nuevo Aviso" />
328       </form>
controlador
Código PHP:
$articulo = new Avisos();
          
$form $this->createForm(new AvisosType(), $articulo);
        
$request $this->getRequest();
        if(
$request->getMethod() == 'POST')
        {
        
$form->bindRequest($request);
            if(
$form->isValid())
               {
            
$data $form->get('categoria')->getData();
            return 
$this->render('DeGualeguaychuAvisosBundle:Default:nuevo.html.twig',array('get'=>$data,'obj' => $articulos,'form' => $form->createView()));
            
            }
        }    
        return 
$this->render('DeGualeguaychuAvisosBundle:Default:nuevo.html.twig',array('get'=>'','obj' => $articulos,'form' => $form->createView())); 
Lo unico que itento hacer ahora, es devolver los datos enviados anteriormente, (solo para poder ver y analizar que es lo que envio), despues pudiendo analizar esos datos los procesare y guardare en la db.

Gracias.