["?content", null, "libellé du bouton radio"], "checked" => ["?bool", null, "le bouton est-il sélectionné?"], "naked_label" => ["?bool", null, "faut-il retourner le bouton avec le label en mode naked?"] ]; /** @var array|string */ protected $ppText; /** @var bool */ protected $ppChecked; /** @var bool */ protected $ppNakedLabel; function getControl(): array { $name = $this->ppName; $value = $this->ppValue; $checked = $this->ppChecked; $disabled = $this->ppDisabled; $control = v::tag1("input", [ "type" => "radio", "id" => $this->ppId, "name" => $name, "value" => $value, "checked" => $checked? "checked": false, "readonly" => $this->ppReadonly? "readonly": false, "disabled" => $disabled ? "disabled": false, "class" => $this->ppClass, "style" => $this->ppStyle, $this->ppAttrs, ]); if ($this->ppNaked && !$this->ppNakedLabel) return $control; $controlLabel = v::div([ "class" => ["radio", $disabled ? "disabled" : false], v::tag("label", [ $control, " ", q($this->ppText), ]), ]); if ($this->ppNaked) return $controlLabel; return $this->getFgsLayout($controlLabel); } }