77 lines
1.8 KiB
PHP
77 lines
1.8 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace App\Form\Site\Page;
|
||
|
|
||
|
use App\Entity\Site\Page\Page;
|
||
|
use Symfony\Component\Form\AbstractType;
|
||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||
|
|
||
|
class PageType extends AbstractType
|
||
|
{
|
||
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||
|
{
|
||
|
$builder->add(
|
||
|
'metaTitle',
|
||
|
TextType::class,
|
||
|
[
|
||
|
'label' => 'Titre',
|
||
|
'required' => false,
|
||
|
'attr' => [
|
||
|
],
|
||
|
'constraints' => [
|
||
|
],
|
||
|
]
|
||
|
);
|
||
|
|
||
|
$builder->add(
|
||
|
'metaDescrition',
|
||
|
TextType::class,
|
||
|
[
|
||
|
'label' => 'Description',
|
||
|
'required' => false,
|
||
|
'attr' => [
|
||
|
],
|
||
|
'constraints' => [
|
||
|
],
|
||
|
]
|
||
|
);
|
||
|
|
||
|
$builder->add(
|
||
|
'ogTitle',
|
||
|
TextType::class,
|
||
|
[
|
||
|
'label' => 'Titre',
|
||
|
'required' => false,
|
||
|
'attr' => [
|
||
|
],
|
||
|
'constraints' => [
|
||
|
],
|
||
|
]
|
||
|
);
|
||
|
|
||
|
$builder->add(
|
||
|
'ogDescription',
|
||
|
TextType::class,
|
||
|
[
|
||
|
'label' => 'Description',
|
||
|
'required' => false,
|
||
|
'attr' => [
|
||
|
],
|
||
|
'constraints' => [
|
||
|
],
|
||
|
]
|
||
|
);
|
||
|
|
||
|
$builder->getData()->buildForm($builder);
|
||
|
}
|
||
|
|
||
|
public function configureOptions(OptionsResolver $resolver)
|
||
|
{
|
||
|
$resolver->setDefaults([
|
||
|
'data_class' => Page::class,
|
||
|
]);
|
||
|
}
|
||
|
}
|