@@ -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,$parameters=NULL); |
33 | 42 | |
34 | 43 | /** |
@@ -67,12 +76,19 @@ discard block |
||
67 | 76 | } |
68 | 77 | } |
69 | 78 | |
79 | + /** |
|
80 | + * @param HtmlFormInput $field |
|
81 | + */ |
|
70 | 82 | protected function _prepareFormFields(&$field,$name,&$attributes){ |
71 | 83 | $field->setName($name); |
72 | 84 | $this->_addRules($field, $attributes); |
73 | 85 | return $field; |
74 | 86 | } |
75 | 87 | |
88 | + /** |
|
89 | + * @param \Closure $elementCallback |
|
90 | + * @param string $prefix |
|
91 | + */ |
|
76 | 92 | protected function _fieldAs($elementCallback,$index,$attributes=NULL,$prefix=null){ |
77 | 93 | $this->setValueFunction($index,function($value) use ($index,&$attributes,$elementCallback,$prefix){ |
78 | 94 | $caption=$this->_getFieldCaption($index); |
@@ -223,6 +239,9 @@ discard block |
||
223 | 239 | } |
224 | 240 | } |
225 | 241 | |
242 | + /** |
|
243 | + * @param integer $index |
|
244 | + */ |
|
226 | 245 | public function fieldAs($index,$type,$attributes=NULL){ |
227 | 246 | $method="fieldAs".\ucfirst($type); |
228 | 247 | if(\method_exists($this, $method)){ |