Nette\Forms\Controls\TextInput::getControl PHP Method

getControl() public method

Generates control's HTML element.
public getControl ( ) : Nette\Utils\Html
return Nette\Utils\Html
    public function getControl()
    {
        return parent::getControl()->addAttributes(['value' => $this->control->type === 'password' ? $this->control->value : $this->getRenderedValue(), 'type' => $this->control->type ?: 'text']);
    }

Usage Example

Beispiel #1
0
 /**
  * Generates control's HTML element
  *
  * @return Html
  */
 public function getControl()
 {
     $control = parent::getControl()->addClass('pswdinput');
     $this->data['fid'] = $this->getForm()->getElementPrototype()->id;
     $control->data('lohini-pswd', \Nette\Utils\Json::encode(array_filter($this->data)));
     return Html::el('span', ['style' => 'position: relative; float: left;'])->add($control);
 }
All Usage Examples Of Nette\Forms\Controls\TextInput::getControl