1 | <?php |
||
8 | class Factory |
||
9 | { |
||
10 | |||
11 | protected $types = array( |
||
12 | 'text' => '\Sirius\Input\Element\Input\Text', |
||
13 | 'file' => '\Sirius\Input\Element\Input\File', |
||
14 | 'textarea' => '\Sirius\Input\Element\Input\Textarea', |
||
15 | 'select' => '\Sirius\Input\Element\Input\Select', |
||
16 | 'multiselect' => '\Sirius\Input\Element\Input\MultiSelect', |
||
17 | 'checkbox' => '\Sirius\Input\Element\Input\Checkbox', |
||
18 | 'button' => '\Sirius\Input\Element\Button', |
||
19 | 'submit' => '\Sirius\Input\Element\Button\Submit', |
||
20 | 'reset' => '\Sirius\Input\Element\Button\Reset', |
||
21 | 'group' => '\Sirius\Input\Element\Group', |
||
22 | 'collection' => '\Sirius\Input\Element\Collection', |
||
23 | 'fieldset' => '\Sirius\Input\Element\Fieldset', |
||
24 | ); |
||
25 | |||
26 | 5 | public function registerElementType($type, $classOrClosure) |
|
48 | |||
49 | /** |
||
50 | * Create element from options |
||
51 | * |
||
52 | * @param $name |
||
53 | * @param array $options |
||
54 | * |
||
55 | * @return \Sirius\Input\Element |
||
56 | * @throws \RuntimeException |
||
57 | */ |
||
58 | 19 | public function createFromOptions($name, $options = array()) |
|
84 | } |
||
85 |