Completed
Pull Request — development (#829)
by
unknown
05:04
created

SupportSearchCaches::buildForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 33

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 33
rs 9.392
c 0
b 0
f 0
1
<?php
2
3
namespace Oc\Form;
4
5
use phpDocumentor\Reflection\DocBlock\Tags\Reference\Url;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8
use Symfony\Component\Form\FormBuilderInterface;
9
10
class SupportSearchCaches extends AbstractType
11
{
12
    /**
13
     * @param FormBuilderInterface $builder
14
     * @param array $options
15
     */
16
    public function buildForm(FormBuilderInterface $builder, array $options)
17
    {
18
        // see: https://symfonycasts.com/screencast/symfony-forms/form-type-class
19
        $builder
20
            ->add(
21
                'content_support_searchfield', null, [
22
                                                 'attr' => [
23
                                                     'placeholder' => 'OC / GC / Name / Owner / %%%',
24
                                                     'autofocus' => 'autofocus',
25
                                                     'size' => '10%',
26
                                                     'minlength' => '3',
27
                                                     'maxlength' => '100',
28
                                                     'style' => 'width: 250px;'
29
                                                 ],
30
                                                 'required' => true,
31
                                                 'disabled' => false,
32
                                                 'label' => false,
33
                                                 'trim' => true
34
                                             ]
35
            )
36
            ->add(
37
                'search_All', SubmitType::class, [
38
                                'attr' => ['class' => 'btn btn-primary', 'style' => 'width: 60px;'],
39
                                'label' => '🔍'
40
                            ]
41
            )
42
            ->add(
43
                'search_One', SubmitType::class, [
44
                                'attr' => ['class' => 'btn btn-primary', 'style' => 'width: 60px;'],
45
                                'label' => '🔍=1'
46
                            ]
47
            );
48
    }
49
}
50