Completed
Branch master (312f5c)
by Derek Stephen
03:48 queued 01:34
created

Hidden::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 8
cts 8
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * User: delboy1978uk
4
 * Date: 19/11/2016
5
 * Time: 21:37
6
 */
7
8
namespace Del\Form\Field;
9
10
use Del\Form\Filter\Adapter\FilterAdapterZf;
11
use Zend\Filter\StringTrim;
12
use Zend\Filter\StripTags;
13
14
class Hidden extends FieldAbstract
15
{
16
    /**
17
     * @return string
18
     */
19 1
    public function getTag()
20
    {
21 1
        return 'input';
22
    }
23
24
25 1
    public function init()
26
    {
27 1
        $this->setAttribute('type', 'hidden');
28 1
        $this->setAttribute('class', 'form-control');
29 1
        $stringTrim = new FilterAdapterZf(new StringTrim());
30 1
        $stripTags = new FilterAdapterZf(new StripTags());
31 1
        $this->addFilter($stringTrim)
32 1
            ->addFilter($stripTags);
33
    }
34
}