public function __toString()
{
if (!$this->visible || $this->name == 'default') {
return '';
}
$str = sprintf('<input type="%s" name="%s" #>', $this->type, $this->name);
if ($this->value !== null) {
$str = str_replace("#", "# value=\"" . $this->value . "\"", $str);
}
if ($this->className) {
$str = str_replace("#", "# class=\"" . $this->className . "\"", $str);
}
if ($this->idName) {
$str = str_replace("#", "# id=\"" . $this->idName . "\"", $str);
}
if ($this->placeholder) {
$str = str_replace("#", "# placeholder=\"" . $this->placeholder . "\"", $str);
}
return str_replace("#", "", $str);
}