<?php
namespace App\Form;
use App\Entity\Hymns;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SearchType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* Class HymnSearchType
* @package App\Form
*/
class HymnSearchType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('hymnsSearch', SearchType::class, [
'required' => false,
'attr' => ['class' => 'search-control'],
'trim' => true,
'label' => 'Search',
'help' => 'Search for hymns where this text is in one of these fields: Title, Text, Other Notes.',
]);
}
/**
* @param OptionsResolver $resolver
*/
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => null,
]);
}
}