Nette\Forms\Controls\BaseControl::getHtmlId PHP Method

getHtmlId() public method

Returns control's HTML id.
public getHtmlId ( ) : string
return string
    public function getHtmlId()
    {
        if (!isset($this->control->id)) {
            $this->control->id = sprintf(self::$idMask, $this->lookupPath());
        }
        return $this->control->id;
    }

Usage Example

Esempio n. 1
0
 public function attached($form)
 {
     if ($form instanceof Form) {
         /** @var Nette\Forms\Container $container */
         $container = $this->getParent();
         $container->addComponent($this->wrappedControl, $this->componentName);
         $container->addComponent($this->applyButton, $this->componentName . '_apply');
         $this->applyButton->controlPrototype->{'data-apply-button'} = $this->wrappedControl->getHtmlId();
     }
 }
All Usage Examples Of Nette\Forms\Controls\BaseControl::getHtmlId