voglio passare un valore booleano al mio DogForm
$dogForm = new DogForm(null, array("has_cats" => $this->getUser()->hasCats()));
$form = $this->createForm($dogForm, $dog);
Ma quando si fa nel mio DogForm
:
if (!isset($options['has_cats'])) {
throw new \Exception("Missing option has_cats, this option is mandatory");
}
E sempre mi danno questo errore
Quindi so che i cani non dovrebbero avere i gatti ma, dove la mia opzione has_cats
andato?
Grazie.
Grazie Kris. Solo così altri sanno che se lo leggono, dovrai aggiungere "has_cats" anche a getDefaultOptions() nel CatForm. –