buttonText = $text; return $this; } public function onClick(string $text): self { $this->onClick = $text; return $this; } /** * @inheritDoc */ public function generateHtml(): string { $id = "id='".$this->getId()."'"; $name = "name='".$this->getName()."'"; $value = is_null($this->buttonText) ? "value='".ucfirst($this->getName())."'" : "value='".$this->buttonText."'"; $class = "class='".implode(" ", $this->classNames)."'"; $onClick = !is_null($this->onClick) ? "onclick='" . $this->onClick . "'" : ""; return ""; } }