public function getControl() { $container = Html::el(); $container->add($this->wrappedControl->getControl()); $container->add($this->applyButton->getControl($this->caption)); return $container; }
public function getControl($caption = NULL) { $control = parent::getControl($caption); $control->setText(""); // Delete content if ($this->icon) { $control->class[] = "hasIcon"; $this->icon->alt = $this->caption; $control->add($this->icon); } if ($this->showCaption) { $control->class[] = "hasCaption"; $control->add(Html::el("span class=caption")->setHtml($this->caption)); } // CSS classes: if ($this->icon and !$this->showCaption) { $control->class[] = "hasIconAndNoCaption"; } elseif (!$this->icon and $this->showCaption) { $control->class[] = "hasCaptionAndNoIcon"; } elseif ($this->icon and $this->showCaption) { $control->class[] = "hasCaptionAndIcon"; } return $control; }
/** * Kontroluje jestli je formulář upraven pro potřeby RequestButtonu. * Tedy že je použit RequestButtonReceiver, nebo zavolán RequestButtonHelper::prepareForm() * * @see RequestButtonReceiver * @see RequestButtonHelper::prepareForm() * @param string * @return Html */ public function getControl($caption = NULL) { if (!$this->formIsPrepared) { throw new \Nette\InvalidStateException('Use RequestButtonReceiver instead AppForm , or call method `RequestButtonHelper::prepareForm($form);` after added all FormControls.'); } return parent::getControl(); }