control->type = 'button'; $this->setOption('type', 'button'); } /** * Is button pressed? */ public function isFilled() : bool { $value = $this->getValue(); return $value !== null && $value !== []; } /** * Bypasses label generation. */ public function getLabel($caption = null) { return null; } /** * Generates control's HTML element. * @param string|object $caption */ public function getControl($caption = null) : \Packetery\Nette\Utils\Html { $this->setOption('rendered', \true); $el = clone $this->control; return $el->addAttributes(['name' => $this->getHtmlName(), 'disabled' => $this->isDisabled(), 'value' => $this->translate($caption ?? $this->getCaption())]); } }