From 1d20c0863b40ebf60951dc27f36f4735ca5a58ad Mon Sep 17 00:00:00 2001 From: kali Date: Mon, 18 Mar 2024 11:07:09 +0300 Subject: [PATCH] update 0.01 --- index.php | 3 +-- src/inputs/Radio.php | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 8c24192..bc36fa4 100644 --- a/index.php +++ b/index.php @@ -37,11 +37,10 @@ $activeForm->field(class: TextInput::class, name: 'bbb', params: []) ->render(); $activeForm->field(class: Radio::class, name: 'nameee',params: ["style" => "color:RED;display:flex"]) - ->setLabel("bbbbb") + ->setOptions(['1' => 'bbb1', '2' => 'vvv3', 3 => 'ggg3', 4 => 'fgfgfgfg4']) ->render(); $activeForm->field(class: Radio::class, name: 'nameee',params: ["style" => "color:RED;display:flex"]) - ->setLabel("bbbbb") ->render(); $activeForm->field(\itguild\forms\inputs\Select::class, 'ddd', ['value' => 2]) diff --git a/src/inputs/Radio.php b/src/inputs/Radio.php index e6f4fdc..0d8cfe9 100644 --- a/src/inputs/Radio.php +++ b/src/inputs/Radio.php @@ -10,7 +10,8 @@ class Radio extends BaseInput use CreateOption; private $name; private $paramsArray; - private $options; + private $options = []; + private $value; private bool $hasLabel = false; private string $labelTitle = ''; @@ -27,8 +28,8 @@ class Radio extends BaseInput { $paramsString = $this->createParams($this->paramsArray); $optionsString = $this->createOption($this->options, $this->value); + $this->html = "$optionsString"; $this->html = " $this->html"; - $this->html = ""; return $this; }