@@ -9,9 +9,16 @@ |
||
9 | 9 | |
10 | 10 | trait FieldTrait { |
11 | 11 | |
12 | + /** |
|
13 | + * @param string $name |
|
14 | + */ |
|
12 | 15 | abstract public function addToProperty($name, $value, $separator=" "); |
13 | 16 | abstract public function addLabel($caption, $style="label-default", $leftSeparator=" "); |
14 | 17 | abstract public function addContent($content,$before=false); |
18 | + |
|
19 | + /** |
|
20 | + * @return string |
|
21 | + */ |
|
15 | 22 | abstract public function getField(); |
16 | 23 | public function setFocus() { |
17 | 24 | $this->getField()->addToProperty("class", State::FOCUS); |
@@ -10,7 +10,6 @@ |
||
10 | 10 | use Ajax\semantic\html\elements\HtmlLabel; |
11 | 11 | use Ajax\semantic\html\modules\HtmlProgress; |
12 | 12 | use Ajax\semantic\html\modules\HtmlRating; |
13 | -use Ajax\semantic\html\collections\HtmlMessage; |
|
14 | 13 | /** |
15 | 14 | * @author jc |
16 | 15 | * @property InstanceViewer $_instanceViewer |
@@ -18,7 +18,14 @@ discard block |
||
18 | 18 | |
19 | 19 | trait FormFieldAsTrait{ |
20 | 20 | |
21 | + /** |
|
22 | + * @param string $prefix |
|
23 | + */ |
|
21 | 24 | abstract protected function _getFieldIdentifier($prefix); |
25 | + |
|
26 | + /** |
|
27 | + * @param \Closure $callback |
|
28 | + */ |
|
22 | 29 | abstract public function setValueFunction($index,$callback); |
23 | 30 | |
24 | 31 | private function _getLabelField($caption,$icon=NULL){ |
@@ -42,6 +49,9 @@ discard block |
||
42 | 49 | $element->fromArray($attributes); |
43 | 50 | } |
44 | 51 | |
52 | + /** |
|
53 | + * @param HtmlFormField $element |
|
54 | + */ |
|
45 | 55 | protected function _addRules($element,$attributes){ |
46 | 56 | if(isset($attributes["rules"])){ |
47 | 57 | $rules=$attributes["rules"]; |
@@ -53,6 +63,10 @@ discard block |
||
53 | 63 | } |
54 | 64 | } |
55 | 65 | |
66 | + /** |
|
67 | + * @param \Closure $elementCallback |
|
68 | + * @param string $identifier |
|
69 | + */ |
|
56 | 70 | protected function _fieldAs($elementCallback,$index,$attributes=NULL,$identifier=null){ |
57 | 71 | $this->setValueFunction($index,function($value) use ($index,&$attributes,$elementCallback){ |
58 | 72 | $caption=$this->_instanceViewer->getCaption($index); |