Last active
April 24, 2019 06:12
-
-
Save abfan1127/3213da57da9ead7237d04c483327904e to your computer and use it in GitHub Desktop.
PHP issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in Controller | |
$form = $this->createForm(new Type\AnimalAdminType($animal), $animal); | |
// in AnimalAdminType | |
$builder->add('animal_photos', 'collection', array( | |
'type' => new \Fftdev\RescueBundle\Form\Type\AnimalPhotoAdminType(), | |
'allow_add' => true, | |
'allow_delete' => true, | |
'by_reference' => false, | |
)); | |
// in AnimalPhotoAdminType | |
public function setDefaultOptions(OptionsResolverInterface $resolver) | |
{ | |
$resolver->setDefaults(array( | |
'data_class' => 'Fftdev\RescueBundle\Model\AnimalPhoto', | |
)); | |
} | |
// in AnimalPhoto | |
public function postSave(\PropelPDO $con = null) { | |
... | |
moves photos and saves name to databse | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment