| @@ 7-15 (lines=9) @@ | ||
| 4 | ||
| 5 | use Ajax\common\html\html5\HtmlInput; |
|
| 6 | ||
| 7 | class HtmlFormInput extends HtmlFormField { |
|
| 8 | use TextFieldsTrait; |
|
| 9 | ||
| 10 | public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) { |
|
| 11 | if(!isset($placeholder)) |
|
| 12 | $placeholder=$label; |
|
| 13 | parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label); |
|
| 14 | } |
|
| 15 | } |
|
| @@ 8-24 (lines=17) @@ | ||
| 5 | use Ajax\semantic\html\collections\form\HtmlFormField; |
|
| 6 | use Ajax\common\html\html5\HtmlTextarea; |
|
| 7 | ||
| 8 | class HtmlFormTextarea extends HtmlFormField { |
|
| 9 | use TextFieldsTrait; |
|
| 10 | ||
| 11 | public function __construct($identifier, $label=NULL,$value=NULL,$placeholder=NULL,$rows=NULL) { |
|
| 12 | if(!isset($placeholder)) |
|
| 13 | $placeholder=$label; |
|
| 14 | parent::__construct("field-".$identifier, new HtmlTextarea($identifier,$value,$placeholder,$rows), $label); |
|
| 15 | } |
|
| 16 | ||
| 17 | /** |
|
| 18 | * Defines the textarea row count |
|
| 19 | * @param int $count |
|
| 20 | */ |
|
| 21 | public function setRows($count){ |
|
| 22 | $this->getField()->setRows($count); |
|
| 23 | } |
|
| 24 | } |
|