You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
902 B
33 lines
902 B
<?php |
|
|
|
declare(strict_types=1); |
|
|
|
namespace App\Form\Type; |
|
|
|
use App\Entity\Url; |
|
use Symfony\Component\Form\AbstractType; |
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
|
use Symfony\Component\Form\FormBuilderInterface; |
|
use Symfony\Component\OptionsResolver\OptionsResolver; |
|
|
|
class LyhendiType extends AbstractType |
|
{ |
|
public function buildForm(FormBuilderInterface $builder, array $options): void |
|
{ |
|
$builder |
|
->add('longUrl', TextType::class) |
|
->add('customString', TextType::class, [ |
|
'required' => false, |
|
]) |
|
->add('submit', SubmitType::class); |
|
} |
|
|
|
public function configureOptions(OptionsResolver $resolver): void |
|
{ |
|
$resolver->setDefaults([ |
|
'data_class' => Url::class, |
|
'csrf_protection' => true, |
|
]); |
|
} |
|
}
|
|
|