| 1 | <?php |
||
| 8 | class Component_toggle |
||
| 9 | extends AbstractComponent |
||
|
|
|||
| 10 | implements ValueComponentInterface, |
||
| 11 | FilterableComponentInterface, |
||
| 12 | DisableableComponentInterface |
||
| 13 | { |
||
| 14 | public $component_type = 'toggle'; |
||
| 15 | |||
| 16 | public function default_model() |
||
| 30 | |||
| 31 | public function required_arguments() |
||
| 35 | |||
| 36 | public function get_template_path() |
||
| 40 | |||
| 41 | /** |
||
| 42 | * This filter is needed when the form is submitted without $.amarkalUIForm, |
||
| 43 | * since the value of the toggle needs to be splitted into an array (when 'multi' is set to true). |
||
| 44 | * When using $.amarkalUIForm to submit the form, the component's getValue/setValue will |
||
| 45 | * handle this. |
||
| 46 | * |
||
| 47 | * @param [string|array] $v |
||
| 48 | * @return [string|array] |
||
| 49 | */ |
||
| 50 | public function filter($v) |
||
| 58 | |||
| 59 | protected function is_selected( $value ) |
||
| 67 | } |