From dc7e2c80a45957d3717a49c13869d36f9bd7d45a Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Tue, 10 Dec 2024 12:25:56 +0300 Subject: [PATCH] email input add --- src/builders/EmailBuilder.php | 16 +++++++++ src/inputs/EmailInput.php | 62 +++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100755 src/builders/EmailBuilder.php create mode 100755 src/inputs/EmailInput.php diff --git a/src/builders/EmailBuilder.php b/src/builders/EmailBuilder.php new file mode 100755 index 0000000..abf4d28 --- /dev/null +++ b/src/builders/EmailBuilder.php @@ -0,0 +1,16 @@ +name = $name; + $this->paramsArray = $paramsArray; + $this->inputTemplate = new SimpleTemplate(); + } + + /** + * @return self + */ + public function create(): self + { + $paramsString = $this->createParams($this->paramsArray); + $label = ""; + $input = ""; + + $this->createLabel(); + + $this->html = str_replace('{input}', $input, $this->inputTemplate->getInputTemplate()); + $this->html = str_replace('{label}', $this->labelString, $this->html); + + return $this; + } + + /** + * @param string $name + * @param array $paramsArray + * @return void + */ + public static function build(string $name, array $paramsArray = []): void + { + $input = new self($name, $paramsArray); + $input->create()->render(); + + } + +} \ No newline at end of file