I am trying to load my formbuilder options from my Doctrine entity FieldTypes
:
$formBuilder->add('type', EntityType::class, array(
'attr' => array('class' => 'form-control select2'), 'label' => 'Type',
'class' => FieldTypes::class,
));
But I get the error message:
Class App\Controller\FieldTypes does not exist
you should put a use at the top of class:
namespace App\Controller;
use App\Entity\FieldTypes;
class MyController
{
// ...
public function myAction()
{
// ...
$formBuilder->add('type', EntityType::class, array(
'attr' => array(
'class' => 'form-control select2'
),
'label' => 'Type',
'class' => FieldTypes::class,
));
// ...
}
// ...
}