1 | <?php |
||
18 | class RadioGroup extends Field |
||
19 | { |
||
20 | /** |
||
21 | * @var string[] map where option values map to option labels |
||
22 | */ |
||
23 | protected $options; |
||
24 | |||
25 | /** |
||
26 | * @var string[] map of HTML attributes for the <input> tag |
||
27 | */ |
||
28 | public $input_attr = []; |
||
29 | |||
30 | /** |
||
31 | * @var string[] map of HTML attributes for the <label> tag |
||
32 | */ |
||
33 | public $label_attr = []; |
||
34 | |||
35 | /** |
||
36 | * @var string|null wrapper tag (e.g. "div", or NULL to disable wrapper-tags) |
||
37 | */ |
||
38 | public $wrapper_tag = 'div'; |
||
39 | |||
40 | /** |
||
41 | * @var string[] map of HTML attributes for the wrapper-tag around each checkbox group |
||
42 | */ |
||
43 | public $wrapper_attr = ['class' => 'radio']; |
||
44 | |||
45 | /** |
||
46 | * @param string $name field name |
||
47 | * @param string[] $options map where option values map to option labels |
||
48 | */ |
||
49 | 2 | public function __construct($name, array $options) |
|
55 | |||
56 | /** |
||
57 | * @inheritdoc |
||
58 | */ |
||
59 | 1 | public function createValidators() |
|
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | 1 | public function renderInput(InputRenderer $renderer, InputModel $model, array $attr) |
|
106 | } |
||
107 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: