@@ -18,6 +18,10 @@ discard block |
||
18 | 18 | trait FieldAsTrait{ |
19 | 19 | |
20 | 20 | abstract protected function _getFieldIdentifier($prefix); |
21 | + |
|
22 | + /** |
|
23 | + * @param \Closure $callback |
|
24 | + */ |
|
21 | 25 | abstract public function setValueFunction($index,$callback); |
22 | 26 | |
23 | 27 | private function _getLabelField($caption,$icon=NULL){ |
@@ -27,6 +31,10 @@ discard block |
||
27 | 31 | |
28 | 32 | protected function _addRules($element,$attributes){} |
29 | 33 | |
34 | + /** |
|
35 | + * @param \Closure $elementCallback |
|
36 | + * @param string $prefix |
|
37 | + */ |
|
30 | 38 | protected function _fieldAs($elementCallback,$index,$attributes=NULL,$prefix=null){ |
31 | 39 | $this->setValueFunction($index,function($value)use ($index,&$attributes,$elementCallback,$prefix){ |
32 | 40 | $name=$this->_instanceViewer->getCaption($index)."[]"; |
@@ -16,7 +16,14 @@ discard block |
||
16 | 16 | |
17 | 17 | trait FormFieldAsTrait{ |
18 | 18 | |
19 | + /** |
|
20 | + * @param string $prefix |
|
21 | + */ |
|
19 | 22 | abstract protected function _getFieldIdentifier($prefix); |
23 | + |
|
24 | + /** |
|
25 | + * @param \Closure $callback |
|
26 | + */ |
|
20 | 27 | abstract public function setValueFunction($index,$callback); |
21 | 28 | |
22 | 29 | private function _getLabelField($caption,$icon=NULL){ |
@@ -40,6 +47,9 @@ discard block |
||
40 | 47 | $element->fromArray($attributes); |
41 | 48 | } |
42 | 49 | |
50 | + /** |
|
51 | + * @param HtmlFormField $element |
|
52 | + */ |
|
43 | 53 | protected function _addRules($element,$attributes){ |
44 | 54 | if(isset($attributes["rules"])){ |
45 | 55 | $rules=$attributes["rules"]; |
@@ -51,6 +61,9 @@ discard block |
||
51 | 61 | } |
52 | 62 | } |
53 | 63 | |
64 | + /** |
|
65 | + * @param \Closure $elementCallback |
|
66 | + */ |
|
54 | 67 | protected function _fieldAs($elementCallback,$index,$attributes=NULL,$identifier=null){ |
55 | 68 | $this->setValueFunction($index,function($value)use ($index,&$attributes,$elementCallback){ |
56 | 69 | $caption=$this->_instanceViewer->getCaption($index); |