Generates control's HTML element.

@return Html
194
public function getControl()
	{
		$control = parent::getControl();
		$control->type = $this->htmlType;
		$control->addClass($this->htmlType);

		list($min, $max) = $this->extractRangeRule($this->getRules());
		if ($min instanceof DateTimeInterface) {
			$control->min = $min->format($this->htmlFormat);
		}
		if ($max instanceof DateTimeInterface) {
			$control->max = $max->format($this->htmlFormat);
		}
		$value = $this->getValue();
		if ($value instanceof DateTimeInterface) {
			$control->value = $value->format($this->htmlFormat);
		}

		return $control;
	}
966582
public function getHTML()
    {
        $details = $this->getHTMLDetails();
        extract($details);
        
        $options = null;
        foreach ($this['options'] as $optValue => $optText) {
            $options .= "<option value='{$optValue}'"
                . (($this['value'] == $optValue)
                    ? " selected=\"selected\""
                    : null)
                . ">{$optText}</option>\n";
        }

        return <<<EOD
<p>
<label for='$id'>$label</label>$brAfterLabel
<select id='$id'{$class}{$name}{$autofocus}{$required}{$readonly}{$checked}{$title}>
{$options}
</select>
{$messages}
</p>
<p class='cf-desc'>{$description}</p>
EOD;
    }
9444
public function getHTML() {
        $tag = '<form';
        $q = $this->quoteType;

        //build attribute strings
        foreach( $this->attrs as $name=>$value ) {
            //if true, such as CHECKED, we just add the name
            if( $value === true )
                    $tag .= " $name";
            elseif( is_string( $value ) ) //if it's a string, we add attr="value"
                    $tag .= " {$name}={$q}{$value}{$q}";
        }

        //not a short tag, close it
        $tag .= '>';

        //add the children if they exist
        if( $this->hasChildren() ) {
            for( $i = 0; $i < count( $this->children ); $i++ ) {
                //datalists are hidden and should not be decorated
                if( $this->children[$i] instanceof Element\Datalist ) {
                    $tag .= $this->children[$i]->getHTML();
                } else {
                    $tag .= $this->decorator->element( $this->children[$i]->getHTML(), $this->titles[$i] );
                }
            }
        }

        //closing tag
        $tag .= "</form>";

        return $this->decorator->form( $tag );
    }
666514
public function onModelFormRenderControlWrapper()
    {
        $type = Input::get('controlType');
        $controlId = Input::get('controlId');
        $properties = Input::get('properties');

        $controlInfo = $this->getControlInfo($type);

        return [
            'markup' => $this->renderControlWrapper($type, $properties),
            'controlId' => $controlId,
            'controlTitle' => Lang::get($controlInfo['name']),
            'description' => Lang::get($controlInfo['description']),
            'type' => $type
        ];
    }
705263
public function toHtml()
    {
        $this->config['html'] = $this->config['text'];
        unset($this->config['text']);
        $this->flash();

        return $this;
    }
420077
public function getHtml(): string
  {
    $html = $this->prefix;
    $html .= Html::generateTag('span', $this->attributes);

    if (is_array($this->options))
    {
      foreach ($this->options as $option)
      {
        $inputAttributes = $this->inputAttributes($option);
        $labelAttributes = $this->labelAttributes($option);

        $labelAttributes['for'] = $inputAttributes['id'];

        // Get the (database) key of the option.
        $key  = $option[$this->keyKey];

        // If an obfuscator is installed compute the obfuscated code of the (database) ID.
        $code = ($this->optionsObfuscator) ? $this->optionsObfuscator->encode(Cast::toOptInt($key)) : $key;

        $inputAttributes['name']    = ($this->submitName!=='') ? $this->submitName.'['.$code.']' : $code;
        $inputAttributes['checked'] = ($this->checkedKey!==null && !empty($option[$this->checkedKey]));

        $html .= Html::generateVoidElement('input', $inputAttributes);

        $html .= $this->labelPrefix;
        $html .= Html::generateElement('label',
                                       $labelAttributes,
                                       Cast::toOptString($option[$this->labelKey]),
                                       $this->labelIsHtml);
        $html .= $this->labelPostfix;
      }
    }

    $html .= '</span>';
    $html .= $this->postfix;

    return $html;
  }
65984
public function getControl()
	{
		// has to run
		parent::getControl();

		$items = $this->getItems();
		$container = $this->container;

		$c = 0;
		$htmlId = $this->getHtmlId();
		foreach ($items as $value => $caption) {
			$disabledOption = $this->isValueDisabled($value);
			$itemHtmlId = $htmlId . $c;

			$wrapper = Html::el('div', [
				'class' => ['custom-control', 'custom-radio'],
			]);

			$input = Html::el('input', [
				'class'    => ['custom-control-input'],
				'type'     => 'radio',
				'value'    => $value,
				'name'     => $this->getHtmlName(),
				'checked'  => $this->isValueSelected($value),
				'disabled' => $disabledOption,
				'id'       => $itemHtmlId,
			]);
			if ($c == 0) {
				// the first (0th) input has data-nette-rules, none other
				$input->setAttribute('data-nette-rules', Helpers::exportRules($this->getRules()));
			}

			$wrapper->addHtml($input);

			$wrapper->addHtml(
				Html::el('label', [
					'class' => ['custom-control-label'],
					'for'   => $itemHtmlId,
				])->setText($caption)
			);

			$container->addHtml($wrapper);
			$c++;
		}

		return $container;
	}
1218612
private function getHtmlBeginning()
	{
		$html = '<' . $this->tagName;

		foreach ($this->attributes as $name => $value) {
			$html .= ' ' . $name . '="' . htmlspecialchars($value) . '"';
		}

		return $html;
	}
1077948
function toHtml(){
        $retval = '';
        if ($this->_hiddenLabel){
            $this->_generateId();
            $retval = '<label class="accesshide" for="'.$this->getAttribute('id').'" >'.
                        $this->getLabel().'</label>'.parent::toHtml();
        } else {
             $retval = parent::toHtml();
        }

        if (!empty($this->_link)) {
            if (!empty($this->_linkreturn) && is_array($this->_linkreturn)) {
                $appendchar = '?';
                if (strstr($this->_link, '?')) {
                    $appendchar = '&amp;';
                }

                foreach ($this->_linkreturn as $key => $val) {
                    $this->_link .= $appendchar."$key=$val";
                    $appendchar = '&amp;';
                }
            }

            $retval .= '<a style="margin-left: 5px" href="'.$this->_link.'">'.$this->_linklabel.'</a>';
        }

        return $retval;
    }
168015
public String getHtmlControl()
    {
        StringWriter sw = new StringWriter();
        PrintWriter rw = new PrintWriter(sw);
        this.getScreenField().printData(rw, HtmlConstants.HTML_DISPLAY);      // DO print screen
        String string = sw.toString();
        return string;
    }
417412
public function generateScripts()
    {
        $parameters = $this->generateJson();

        return new HtmlString(
            sprintf($this->template(), $this->getTableAttribute('id'), $parameters)
        );
    }
10143
protected function getHtmlBody(): string
  {
    $ret = '';
    $i   = 0;
    foreach ($this->controls as $control)
    {
      if ($control!==$this->footerControl)
      {
        $control->addClass(OverviewTable::$class);
        $control->addClass(($i % 2==0) ? 'even' : 'odd');

        $ret .= $control->getHtml();

        $i++;
      }
    }

    return $ret;
  }
1309797
protected function buildScriptText()
    {
        $controlId  = Builder::escapeText($this->control->getId());
        $scriptText = '';
        $closeBlock = false;
        if (ScriptLabel::isEventLabel($this->labelName)) {
            $scriptText .= "
if (Event.ControlId == {$controlId}) {
declare Control <=> Event.Control;";
            $closeBlock = true;
        } else {
            $scriptText .= "
declare Control <=> Page.GetFirstChild({$controlId});";
        }
        $class      = $this->control->getManiaScriptClass();
        $name       = preg_replace('/^CMl/', '', $class, 1);
        $scriptText .= "
declare {$name} <=> (Control as {$class});
";
        $scriptText .= $this->scriptText . "
";
        if ($closeBlock) {
            $scriptText .= "}";
        }
        return $scriptText;
    }
740325
public function renderElements()
    {
        if ($this->isSelfClosing) {
            return '';
        }

        $html = '';

        foreach ($this->elements as $element) {
            $html .= $element;
        }

        return $html;
    }
324205
protected function getHtmlPrefixLabel(): string
  {
    // If a label must be generated make sure the form control and the label have matching 'id' and 'for' attributes.
    if (isset($this->labelPosition))
    {
      if (!isset($this->attributes['id']))
      {
        $id                           = Html::getAutoId();
        $this->attributes['id']       = $id;
        $this->labelAttributes['for'] = $id;
      }
      else
      {
        $this->labelAttributes['for'] = $this->attributes['id'];
      }
    }

    // Generate a prefix label, if required.
    if ($this->labelPosition=='pre')
    {
      $ret = $this->getHtmlLabel();
    }
    else
    {
      $ret = '';
    }

    return $ret;
  }
129649
public function getHtmlAttributes()
    {
        if ( $this->getValue()) {
            $this->_attributes['checked'] = 'checked';
        }
        $text = parent::getHtmlAttributes();
        $text = str_replace('form-control', '', $text);
        return $text;
    }
206863
public function generate()
    {
        return sprintf(
            '<input type="hidden" id="ctrl_%s" name="%s" value="%s" /><span>%s</span>',
            $this->strId,
            $this->strName,
            StringUtil::specialchars($this->varValue),
            $this->label
        );
    }