Custom form type
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\ORM\EntityManager;
class NationaliteitidType extends AbstractType
{
private $doctrine;
private $em;
public function __construct(EntityManager $em)
{
$this->em = $em;
}
service.yml services:
fw_core.form.type:
class: FW\CoreBundle\Form\Type\NationaliteitidType
arguments:
entityManager: "@doctrine.orm.entity_manager"
error:
Argument 1 passed to FW\CoreBundle\Form\TypeNationaliteitidType::__construct() must be an instance of Doctrine\ORM\EntityManager, none given,
I must have made an type or something else obvious but realy can't find it.