From ba427cb74f04e2645286bed9cd1e52cd9352bda7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B8=D0=B4=D0=BE=D1=80=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=92=D0=B0=D0=B4=D0=B8?= =?UTF-8?q?=D0=BC=D0=BE=D0=B2=D0=B8=D1=87?= Date: Fri, 15 Mar 2024 14:09:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?src/inputs=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/inputs/Button.php | 33 +++++++++++++++++++++++++++++++++ src/inputs/Checkbox.php | 34 ++++++++++++++++++++++++++++++++++ src/inputs/Label.php | 35 +++++++++++++++++++++++++++++++++++ src/inputs/Radio.php | 27 +++++++++++++++++++++++++++ src/inputs/Select.php | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 166 insertions(+) create mode 100644 src/inputs/Button.php create mode 100644 src/inputs/Checkbox.php create mode 100644 src/inputs/Label.php create mode 100644 src/inputs/Radio.php create mode 100644 src/inputs/Select.php diff --git a/src/inputs/Button.php b/src/inputs/Button.php new file mode 100644 index 0000000..a377ac3 --- /dev/null +++ b/src/inputs/Button.php @@ -0,0 +1,33 @@ +name = $name; + $this->paramsArray = $paramsArray; + $this->value = $value; + } + + public function create(): void + { + $paramsString = $this->createParams($this->paramsArray); + echo ""; + } + + public static function build(string $name, string $value, array $paramsArray = []): void + { + $input = new self($name, $value, $paramsArray); + $input->create(); + } + +} \ No newline at end of file diff --git a/src/inputs/Checkbox.php b/src/inputs/Checkbox.php new file mode 100644 index 0000000..ea3796a --- /dev/null +++ b/src/inputs/Checkbox.php @@ -0,0 +1,34 @@ +name = $name; + $this->value = $value; + $this->paramsArray = $paramsArray; + } + public function create(): void + { + $paramsString = $this->createParams($this->paramsArray); + echo ""; + } + + public static function build(string $name, string $value, array $paramsArray): void + { + $checkbox = new self($name, $value, $paramsArray); + $checkbox->create(); + + } + +} \ No newline at end of file diff --git a/src/inputs/Label.php b/src/inputs/Label.php new file mode 100644 index 0000000..2b829c5 --- /dev/null +++ b/src/inputs/Label.php @@ -0,0 +1,35 @@ +title = $title; + $this->paramsArray = $paramsArray; + } + + public function create(): void + { + $paramsString = $this->createParams($this->paramsArray); + echo ""; + + } + + public static function build(string $title, array $paramsArray = []) + { + $label = new self($title, $paramsArray); + $label->create(); + + } + + + +} \ No newline at end of file diff --git a/src/inputs/Radio.php b/src/inputs/Radio.php new file mode 100644 index 0000000..18bae67 --- /dev/null +++ b/src/inputs/Radio.php @@ -0,0 +1,27 @@ +name = $name; + $this->paramsArray = $paramsArray; + } + public function create(): void + { + $paramsString = $this->createParams($this->paramsArray); + echo ""; + } + + public static function build(string $name, array $paramsArray = []): void + { + $label = new self($name, $paramsArray); + $label->create(); + } +} \ No newline at end of file diff --git a/src/inputs/Select.php b/src/inputs/Select.php new file mode 100644 index 0000000..4a9ca2b --- /dev/null +++ b/src/inputs/Select.php @@ -0,0 +1,37 @@ +name = $name; + $this->options = $options; + $this->value = $value; + $this->paramsArray = $paramsArray; + } + public function create(): void + { + $paramsString = $this->createParams($this->paramsArray); + $optionsString = $this->createOption($this->options, $this->value); + echo ""; + + } + public static function build(string $name, array $options = [], $value = null, array $paramsArray = []): void + { + $textarea = new self($name, $options, $value, $paramsArray); + $textarea->create(); + } + +} \ No newline at end of file