| @@ 6-30 (lines=25) @@ | ||
| 3 | ||
| 4 | namespace Sco\Admin\Form\Elements; |
|
| 5 | ||
| 6 | class Text extends Input |
|
| 7 | { |
|
| 8 | protected $type = 'text'; |
|
| 9 | ||
| 10 | protected $size = ''; |
|
| 11 | ||
| 12 | public function getSize() |
|
| 13 | { |
|
| 14 | return $this->size; |
|
| 15 | } |
|
| 16 | ||
| 17 | public function setSize($value) |
|
| 18 | { |
|
| 19 | $this->size = $value; |
|
| 20 | ||
| 21 | return $this; |
|
| 22 | } |
|
| 23 | ||
| 24 | public function toArray() |
|
| 25 | { |
|
| 26 | return parent::toArray() + [ |
|
| 27 | 'size' => $this->getSize(), |
|
| 28 | ]; |
|
| 29 | } |
|
| 30 | } |
|
| 31 | ||
| @@ 5-29 (lines=25) @@ | ||
| 2 | ||
| 3 | namespace Sco\Admin\Form\Elements; |
|
| 4 | ||
| 5 | class Textarea extends Input |
|
| 6 | { |
|
| 7 | protected $type = 'textarea'; |
|
| 8 | ||
| 9 | protected $rows = 2; |
|
| 10 | ||
| 11 | public function getRows() |
|
| 12 | { |
|
| 13 | return $this->rows; |
|
| 14 | } |
|
| 15 | ||
| 16 | public function setRows($value) |
|
| 17 | { |
|
| 18 | $this->rows = $value; |
|
| 19 | ||
| 20 | return $this; |
|
| 21 | } |
|
| 22 | ||
| 23 | public function toArray() |
|
| 24 | { |
|
| 25 | return parent::toArray() + [ |
|
| 26 | 'rows' => $this->getRows() |
|
| 27 | ]; |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||