-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9f077a
commit 43a8d6f
Showing
6 changed files
with
219 additions
and
57 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace App\Form; | ||
|
||
use App\Entity\CategorieUsageNavire; | ||
use App\Entity\Navire; | ||
use Symfony\Bridge\Doctrine\Form\Type\EntityType; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
class NavireNavProType extends AbstractType { | ||
|
||
public function buildForm(FormBuilderInterface $builder, array $options) { | ||
$builder | ||
->add('immatriculation', TextType::class, [ | ||
'attr' => ['class' => "immatriculation fr-input fr-mb-2w"], | ||
'label' => "Immatriculation du navire" | ||
]) | ||
->add('pavillon', TextType::class, [ | ||
'required' => true, | ||
'label' => "Pavillon du navire", | ||
'attr' => [ | ||
'class' => 'fr-input fr-mb-2w' | ||
] | ||
]) | ||
->add('nom', TextType::class, [ | ||
'required' => true, | ||
'label' => "Nom du navire", | ||
'attr' => [ | ||
'class' => 'fr-input fr-mb-2w' | ||
] | ||
] | ||
) | ||
->add('categorieUsageNavire', EntityType::class, [ | ||
'required' => true, | ||
'class' => CategorieUsageNavire::class, | ||
'multiple' => false, | ||
'expanded' => false, | ||
'placeholder' => "Sélectionnez une catégorie", | ||
'choice_label' => "nom", | ||
'label' => "Catégorie du navire contrôlé", | ||
'attr' => [ | ||
'class' => 'fr-select fr-mb-2w' | ||
] | ||
]); | ||
} | ||
|
||
public function configureOptions(OptionsResolver $resolver) { | ||
$resolver->setDefaults([ | ||
'data_class' => Navire::class, | ||
]); | ||
} | ||
|
||
} |
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
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