type = $type; $this->item = $item; } public function toString() { return Template::render('input/' . $this->type, $this->item); } public function __toString() { try { return $this->toString(); } catch (Throwable $e) { error_log($e->getMessage()); return ''; } } }