@@ -20,6 +20,9 @@ |
||
| 20 | 20 | class DataForm extends Widget { |
| 21 | 21 | use FormTrait; |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $identifier |
|
| 25 | + */ |
|
| 23 | 26 | public function __construct($identifier, $modelInstance=NULL) { |
| 24 | 27 | parent::__construct($identifier, null,$modelInstance); |
| 25 | 28 | $this->_init(new FormInstanceViewer($identifier), "form", new HtmlForm($identifier), true); |
@@ -17,7 +17,14 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | trait FormFieldAsTrait{ |
| 19 | 19 | |
| 20 | + /** |
|
| 21 | + * @param string $prefix |
|
| 22 | + */ |
|
| 20 | 23 | abstract protected function _getFieldIdentifier($prefix); |
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * @param \Closure $callback |
|
| 27 | + */ |
|
| 21 | 28 | abstract public function setValueFunction($index,$callback); |
| 22 | 29 | abstract protected function _applyAttributes($element,&$attributes,$index); |
| 23 | 30 | abstract public function getIdentifier(); |
@@ -39,6 +46,10 @@ discard block |
||
| 39 | 46 | } |
| 40 | 47 | } |
| 41 | 48 | |
| 49 | + /** |
|
| 50 | + * @param \Closure $elementCallback |
|
| 51 | + * @param string $prefix |
|
| 52 | + */ |
|
| 42 | 53 | protected function _fieldAs($elementCallback,$index,$attributes=NULL,$prefix=null){ |
| 43 | 54 | $this->setValueFunction($index,function($value) use ($index,&$attributes,$elementCallback){ |
| 44 | 55 | $caption=$this->_instanceViewer->getCaption($index); |