@@ -26,9 +26,18 @@ discard block |
||
| 26 | 26 | trait FieldAsTrait{ |
| 27 | 27 | |
| 28 | 28 | abstract protected function _getFieldIdentifier($prefix,$name=""); |
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * @param \Closure $callback |
|
| 32 | + */ |
|
| 29 | 33 | abstract public function setValueFunction($index,$callback); |
| 30 | 34 | abstract protected function _getFieldName($index); |
| 31 | 35 | abstract protected function _getFieldCaption($index); |
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * @param HtmlButton $button |
|
| 39 | + * @param string $event |
|
| 40 | + */ |
|
| 32 | 41 | abstract protected function _buttonAsSubmit(&$button,$event,$url,$responseElement=NULL); |
| 33 | 42 | |
| 34 | 43 | /** |
@@ -65,12 +74,19 @@ discard block |
||
| 65 | 74 | } |
| 66 | 75 | } |
| 67 | 76 | |
| 77 | + /** |
|
| 78 | + * @param HtmlFormInput $field |
|
| 79 | + */ |
|
| 68 | 80 | protected function _prepareFormFields(&$field,$name,&$attributes){ |
| 69 | 81 | $field->setName($name); |
| 70 | 82 | $this->_addRules($field, $attributes); |
| 71 | 83 | return $field; |
| 72 | 84 | } |
| 73 | 85 | |
| 86 | + /** |
|
| 87 | + * @param \Closure $elementCallback |
|
| 88 | + * @param string $prefix |
|
| 89 | + */ |
|
| 74 | 90 | protected function _fieldAs($elementCallback,$index,$attributes=NULL,$prefix=null){ |
| 75 | 91 | $this->setValueFunction($index,function($value) use ($index,&$attributes,$elementCallback,$prefix){ |
| 76 | 92 | $caption=$this->_getFieldCaption($index); |
@@ -218,6 +234,9 @@ discard block |
||
| 218 | 234 | } |
| 219 | 235 | } |
| 220 | 236 | |
| 237 | + /** |
|
| 238 | + * @param integer $index |
|
| 239 | + */ |
|
| 221 | 240 | public function fieldAs($index,$type,$attributes=NULL){ |
| 222 | 241 | $method="fieldAs".\ucfirst($type); |
| 223 | 242 | |