| Conditions | 7 |
| Paths | 16 |
| Total Lines | 37 |
| 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 ($attr === 'value') { // There is no value attribute for textarea fields |
||
| 34 | continue; |
||
| 35 | } |
||
| 36 | |||
| 37 | if ($attr === 'name' && !empty($this->getName())) { |
||
| 38 | continue; |
||
| 39 | } |
||
| 40 | |||
| 41 | $output .= $attr . '="' . $value . '" '; |
||
| 42 | |||
| 43 | } |
||
| 44 | |||
| 45 | if (!empty($this->getName())) { |
||
| 46 | $output .= ' name="' . $this->getName() . '"'; |
||
| 47 | } |
||
| 48 | |||
| 49 | $output .= '>'; |
||
| 50 | |||
| 51 | if (!empty($this->getValue())) { |
||
| 52 | $output .= $this->getValue(); |
||
| 53 | } |
||
| 54 | |||
| 55 | $output .= '</textarea>'; |
||
| 56 | |||
| 57 | $this->element = $output; |
||
| 58 | |||
| 59 | return $this; |
||
| 60 | |||
| 61 | } |
||
| 62 | |||
| 63 | } |