create site with form to add offerings
This commit is contained in:
parent
781c8602d9
commit
b212d1fa74
4 changed files with 53 additions and 0 deletions
30
src/Form/OfferingFormType.php
Normal file
30
src/Form/OfferingFormType.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Offering;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class OfferingFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('createdAt')
|
||||
->add('title')
|
||||
->add('photoFilename')
|
||||
->add('zipCode')
|
||||
->add('description')
|
||||
->add('byUser')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Offering::class,
|
||||
]);
|
||||
}
|
||||
}
|
Reference in a new issue