<?php
|
declare(strict_types=1);
|
|
namespace App\Form;
|
|
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\Validator\Constraints\Length;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
|
/**
|
* @extends AbstractType<array{who: string}>
|
*/
|
class BorrowType extends AbstractType {
|
public function buildForm(FormBuilderInterface $builder, array $options): void {
|
$builder
|
->add('who', TextType::class, [
|
'label' => 'borrow_who_header',
|
'constraints' => [new NotBlank(), new Length(max: 255)],
|
])
|
->add('save', SubmitType::class, ['label' => 'borrow_action_lend']);
|
}
|
}
|