I have create a entity "Fact" width "date" attribute.
/**
* Fact
*
* @ORM\Table(name="fact")
* @ORM\Entity()
*/
class Fact
{
.....
/**
* @var \DateTime
*
* @ORM\Column(name="date", type="datetime")
*/
private $date;
/**
* Get date
*
* @return \DateTime
*/
public function getDate()
{
return $this->date;
}
...
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('date', 'date')
}
Than i create its CRUD interfaces with symfony command (also i use bootstrapSymfonyBundle):
php app/console generate:doctrine:crud --entity=MlatAdminBundle:Fact --format=annotation
So i got this error:
Impossible to access an attribute ("date") on a string variable ("inline") in ... /vendor/braincrafted/bootstrap-bundle/Bc/Bundle/BootstrapBundle/Resources/views/Form/form_div_layout.html.twig at line 189
I think that the return type of getDate() function is the problem. I casted it in DateTime Object but nothing change.