Código:
El código es muy sencillito ,estoy solo testeando por ahora.Warning: spl_object_hash() expects parameter 1 to be object, integer given in /var/ww
Código:
Por cierto, al layout index.html.twig llegan los datos correctamente , por lo que no entiendo el error.<?php
namespace Book\MainBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Book\MainBundle\Entity\Book;
class DefaultController extends Controller
{
public function indexAction($book)
{
$book = new Book();
$book->setPhrase('Continua...');
$book->setParentBranch(1);
$book->setCreatorUid(1);
var_dump($book);
$em = $this->getDoctrine()->getManager();
$em->persist($book);
$em->flush();
return $this->render('BookMainBundle:Default:index.html.twig', array('book' => $book));
}
}
Un saludo y gracias de antemano.




