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

SupportSearchCaches   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 33 1
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