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(); } }