Formal\Element\Text::render PHP Method

render() public method

public render ( )
    function render()
    {
        $disabled = "";
        $inputclass = "";
        $groupclass = "";
        $placeholder = "";
        $value = $this->value();
        $label = $this->option("label");
        $prop = $this->option("prop");
        $placeholder = "";
        $helpblock = "";
        $popover = "";
        if ($this->option("readonly") === true) {
            $inputclass .= " disabled";
            $disabled = " disabled";
        }
        if ($this->option("error") === true) {
            $groupclass .= " error";
        }
        if (trim($this->option("class")) !== "") {
            $groupclass .= " " . $this->option("class");
        }
        if (trim($this->option("inputclass")) !== "") {
            $inputclass = $this->option("inputclass");
        }
        if (($sPlaceHolder = trim($this->option("placeholder"))) !== "") {
            $placeholder = " placeholder=\"" . htmlspecialchars($sPlaceHolder) . "\" ";
        }
        $clientvalue = htmlspecialchars($value);
        $sInputType = $this->inputtype();
        if (($sHelp = trim($this->option("help"))) !== "") {
            $helpblock = "<p class=\"help-block\">" . $sHelp . "</p>";
        }
        if (($aPopover = $this->option("popover")) !== "") {
            if (array_key_exists("position", $aPopover)) {
                $sPosition = $aPopover["position"];
                $inputclass .= " popover-focus-" . $sPosition;
            } else {
                $inputclass .= " popover-focus ";
            }
            $popover = " title=\"" . htmlspecialchars($aPopover["title"]) . "\" ";
            $popover .= " data-content=\"" . htmlspecialchars($aPopover["content"]) . "\" ";
        }
        $sHtml = <<<HTML
<div class="control-group{$groupclass}">
\t<label class="control-label" for="{$prop}">{$label}</label>
\t<div class="controls">
\t\t<input type="{$sInputType}" class="{$inputclass}" id="{$prop}" name="data[{$prop}]" value="{$clientvalue}"{$disabled}{$placeholder}{$popover}/>
\t\t{$helpblock}
\t</div>
</div>
HTML;
        return $sHtml . $this->renderWitness();
    }