@@ -24,6 +24,10 @@ discard block |
||
| 24 | 24 | trait FieldAsTrait{ |
| 25 | 25 | |
| 26 | 26 | abstract protected function _getFieldIdentifier($prefix); |
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * @param \Closure $callback |
|
| 30 | + */ |
|
| 27 | 31 | abstract public function setValueFunction($index,$callback); |
| 28 | 32 | |
| 29 | 33 | /** |
@@ -49,6 +53,10 @@ discard block |
||
| 49 | 53 | |
| 50 | 54 | protected function _addRules($element,&$attributes){} |
| 51 | 55 | |
| 56 | + /** |
|
| 57 | + * @param \Closure $elementCallback |
|
| 58 | + * @param string $prefix |
|
| 59 | + */ |
|
| 52 | 60 | protected function _fieldAs($elementCallback,$index,$attributes=NULL,$prefix=null){ |
| 53 | 61 | $this->setValueFunction($index,function($value) use ($index,&$attributes,$elementCallback,$prefix){ |
| 54 | 62 | $name=$this->_instanceViewer->getCaption($index)."[]"; |
@@ -1,7 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Ajax\semantic\widgets\base; |
| 3 | -use Ajax\semantic\html\elements\HtmlInput; |
|
| 4 | -use Ajax\semantic\html\modules\checkbox\HtmlCheckbox; |
|
| 5 | 3 | use Ajax\service\JString; |
| 6 | 4 | use Ajax\semantic\html\modules\HtmlDropdown; |
| 7 | 5 | use Ajax\semantic\html\elements\HtmlImage; |