| Conditions | 8 |
| Paths | 8 |
| Total Lines | 30 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function create() |
||
| 26 | { |
||
| 27 | parent::create(); |
||
| 28 | |||
| 29 | $output = '<' . $this->inputType; |
||
| 30 | |||
| 31 | foreach ($this->definition['attributes'] as $attr => $value) { |
||
| 32 | |||
| 33 | if (!empty($this->getValue()) && $attr === 'value') { |
||
| 34 | continue; |
||
| 35 | } |
||
| 36 | |||
| 37 | if ($attr === 'name' && $value === 'csrf' && $this->getValue()) { |
||
| 38 | continue; |
||
| 39 | } |
||
| 40 | |||
| 41 | $output .= ' ' . $attr . '="' . $value . '" '; |
||
| 42 | |||
| 43 | } |
||
| 44 | |||
| 45 | if (!empty($this->getValue())) { |
||
| 46 | $output .= ' value="' . $this->getValue() . '"'; |
||
| 47 | } |
||
| 48 | |||
| 49 | $output .= '/>'; |
||
| 50 | |||
| 51 | $this->element = $output; |
||
| 52 | |||
| 53 | return $this; |
||
| 54 | } |
||
| 55 | |||
| 56 | } |