I am looking for answers from the Internet, but I can not find the reason: I have a dining company, companyType table, so:
class Company
{
private $id;
private $companyType;
...
}
class CompanyType
{
private $id;
private $name;
....
public function __toString(){
return $this->name;
}
}
and then in the formtype class:
class CompanyForm extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('name')
->add('siren')
->add('siret')
->add('tvaCommun')
->add('apeCode')
;
$builder->add('activity','collection', array('type'=> new ActivityForm()));
$builder->add('companyType','entity',array(
'class' => 'AcmeUserBundle:CompanyType',
));
}
...
}
when i try to use the form:
{{ form_row(company.companyType) }}
In the view, I received an error message.
source
share