<?php
namespace Products\NotificationsBundle\Form\Forms\Templates;
use App\Form\Forms\SearchForm;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\SearchType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
final class TemplateSearchForm extends SearchForm
{
/**
* {@inheritDoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
parent::buildForm($builder, $options);
$builder
->add('defaults', HiddenType::class, [
'required' => false,
])
->add('lookup', SearchType::class, [
'required' => false,
'attr' => [
'placeholder' => 'Search templates...',
],
])
;
}
/**
* {@inheritDoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefault('search_filters_label_format', 'app.notifications.templates.filters.%s');
}
}