Wie Übergeben von Parametern zu benutzerdefiniertem Formulartyp in Controller mit CreateForm-Methode in Symfony3? Der Parameter ist "type" In BannerType.php:Warnung: Fehlendes Argument 1 für BannerType :: __ construct()
public function __construct($type){
$this->type = $type;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Banner\BannerBundle\Entity\Banner',
'type' => null,
));
}
In BannerController.php:
$form = $this->createForm(BannerType::class, $entity, array(
'typee' => $type,
));
Sie haben im createForm-Parameter einen Tippfehler: 'typee' anstelle von 'type'. – Starspire
Danke, aber es ist ein Tippfehler Kein Einfluss – mahdi