|
11 | 11 | use Ajax\semantic\html\collections\form\HtmlFormCheckbox; |
12 | 12 | use Ajax\semantic\html\collections\form\HtmlFormInput; |
13 | 13 | use Ajax\semantic\html\collections\form\HtmlFormDropdown; |
| 14 | +use Ajax\semantic\html\collections\form\HtmlFormTextarea; |
14 | 15 |
|
15 | 16 | /** |
16 | 17 | * @author jc |
@@ -48,7 +49,7 @@ protected function _addRules($element,&$attributes){} |
48 | 49 |
|
49 | 50 | protected function _fieldAs($elementCallback,$index,$attributes=NULL,$prefix=null){ |
50 | 51 | $this->setValueFunction($index,function($value) use ($index,&$attributes,$elementCallback,$prefix){ |
51 | | - $name=$this->_instanceViewer->getCaption($index)."[]"; |
| 52 | + $name=$this->_instanceViewer->getFieldName($index)."[]"; |
52 | 53 | if(isset($attributes["name"])){ |
53 | 54 | $name=$attributes["name"]; |
54 | 55 | } |
@@ -127,6 +128,14 @@ public function fieldAsInput($index,$attributes=NULL){ |
127 | 128 | }, $index,$attributes,"input"); |
128 | 129 | } |
129 | 130 |
|
| 131 | + public function fieldAsTextarea($index,$attributes=NULL){ |
| 132 | + return $this->_fieldAs(function($id,$name,$value){ |
| 133 | + $textarea=new HtmlFormTextarea($id,null,$value); |
| 134 | + $textarea->setName($name); |
| 135 | + return $textarea; |
| 136 | + }, $index,$attributes,"textarea"); |
| 137 | + } |
| 138 | + |
130 | 139 | public function fieldAsHidden($index,$attributes=NULL){ |
131 | 140 | if(!\is_array($attributes)){ |
132 | 141 | $attributes=[]; |
|
0 commit comments