Generate HTML

See {@link \ValidFormBuilder\Element::toHtml()}

@see \ValidFormBuilder\Element::toHtml()
335585
public function toHtml($submitted = false, $blnSimpleLayout = false, $blnLabel = true, $blnDisplayError = true)
    {
        $strOutput = "";
        $this->setConditionalMeta();

        $strValue = $this->__getValue($submitted);
        $strValue = htmlspecialchars($strValue, ENT_QUOTES);

        $strOutput .= "<input type=\"hidden\" value=\"{$strValue}\" name=\"{$this->__name}\" id=\"{$this->__id}\" {$this->__getFieldMetaString()} />\n";

        return $strOutput;
    }
870449
function toHTML()
    {

        // all date controls must have the "date" rule set or we trigger an error
        if (!isset($this->rules['date'])) _zebra_form_show_error('The control named <strong>"' . $this->attributes['name'] . '"</strong> in form <strong>"' . $this->form_properties['name'] . '"</strong> must have the <em>"date"</em> rule set', E_USER_ERROR);

        return '
            <div>
                <input ' . $this->_render_attributes() . ($this->form_properties['doctype'] == 'xhtml' ? '/' : '') . '>
                <div class="clear"></div>
            </div>
        ';

    }
233599
public function generatepage_html(){
		$bhtml=BHTML::getInstance();
		$status=200;
		//Forming page from blocks...
		$jsused=array();
		$cssused=array();
		foreach($this->rules as &$c){
			if(isset($this->positions[$c->position])){
				$this->positions[$c->position].=$c->output;
				}else{
				$this->positions[$c->position]=$c->output;
				}
			if($c->status!=200){
				$status=$c->status;
				}
			if(isset($c->locationurl)){
				$bhtml->setLocationUrl($c->locationurl,$c->locationtime);
				}
			if(isset($c->modified)){
				$bhtml->setLastModified($c->modified);
				}
			if(isset($c->title)){
				$bhtml->setTitle($c->title);
				}
			if(isset($c->meta)){
				foreach($c->meta as $meta){
					$bhtml->add_meta($meta['name'],$meta['content'],$meta['http_equiv']);
					}
				}
			if(isset($c->link)){
				foreach($c->link as $link){
					//Remove dublicates...
					$wasused=false;
					if($link['rel']=='stylesheet'){
						$wasused=isset($cssused[$link['href']]);
						$cssused[$link['href']]=1;
						}
					if(!$wasused){
						$bhtml->add_link($link);
						}
					}
				}
			if(isset($c->js)){
				foreach($c->js as $js){
					//Remove dublicates...
					$wasused=false;
					if(!empty($js['file'])){
						$wasused=isset($jsused[$js['file']]);
						$jsused[$js['file']]=1;
						}
					if(!$wasused){
						$bhtml->addJS($js['file'],$js['src'],$js['priority']);
						}
					}
				}
			if(isset($c->style)){
				foreach($c->style as $st){
					$bhtml->addCSSDeclaration($st);
					}
				}
			if(isset($c->frameworks)){
				foreach($c->frameworks as $framework){
					$bhtml->useFramework($framework);
					}
				}
			//Add breadcrumbs elements
			if(isset($c->breadcrumbs)){
				bimport('cms.breadcrumbs');
				$gbc=BGeneralBreadcrumbs::getInstance();
				foreach($c->breadcrumbs as $bc){
					$gbc->elements[]=$bc;
					}
				}
			}
		//Output the page
		header('Content-Type: text/html; charset=utf-8');
		if($status==403){
			header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden');
			}
		if($status==404){
			header($_SERVER['SERVER_PROTOCOL'].' 404 Page Not Found');
			}
		if($status==500){
			header($_SERVER['SERVER_PROTOCOL'].' 500 Server Error!');
			}
		$bhtml->headers_check();
		//Check for last-modified
		if((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))&&(isset($bhtml->last_modified))){
			$mod_since=new DateTime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
			$interval=date_diff($bhtml->last_modified,$mod_since);
			if($interval->invert==0){
	        		header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');
				return;//return nothing!
				}
			}
		if($this->templatename===NULL){
			$this->templatename='default';
			}
		//Detect device...
		$device=BBrowserUseragent::detectDevice();
		if($device==DEVICE_TYPE_MPHONE){
			$suffix='.m';
			}
		elseif($device==DEVICE_TYPE_TABLET){
			$suffix='.m';
			}else{
			$suffix='.d';
			}
		$fn=BTEMPLATESPATH.$this->templatename.DIRECTORY_SEPARATOR.'template'.$suffix.'.php';
		//
		if(!file_exists($fn)){
			$fn=BTEMPLATESPATH.$this->templatename.DIRECTORY_SEPARATOR.'template.d.php';
			}
		//
		if(!file_exists($fn)){
			$fn=BTEMPLATESPATH.'default'.DIRECTORY_SEPARATOR.'template'.$suffix.'.php';
			}
		//
		if(!file_exists($fn)){
			$fn=BTEMPLATESPATH.'default'.DIRECTORY_SEPARATOR.'template.d.php';
			}

		//Starting render
		if(DEBUG_MODE){
			BLog::addToLog('[Router]: Rendering template...');
			}
		ob_start();
		include $fn;
		$tpl_str=ob_get_clean();
		$tpl_str=str_replace('{{head}}','',$tpl_str);
		if(DEBUG_MODE){
			BLog::addToLog('[Router]: Filling empty positions...');
			}
		$pattern='/{{position.(?P<position>\w+)*}}/';
		preg_match_all($pattern, $tpl_str, $matches);
		foreach($matches['position'] as $pos){
			if(!isset($this->positions[$pos])){
				$this->positions[$pos]='';
				}
			}
		if(DEBUG_MODE){
			BLog::addToLog('[Router]: Put content into positions...');
			}
		foreach($this->positions as $p=>$val){
			$tpl_str=str_replace('{{position:'.$p.'}}',$val,$tpl_str);
			}
		//Output debug information, if necessary.
		if(DEBUG_MODE){
			BLog::addToLog('[Router]: Generation time: '.sprintf('%7.7f',self::page_time()));
			BLog::addToLog('[Router]: MySQL queries:'.BMySQL::getQueriesCount());
			$qc=BCache::getQueriesCount();
			BLog::addToLog('[Router]: Cache queries: get-'.$qc['get'].' set-'.$qc['set'].' mset-'.$qc['mset'].' mget-'.$qc['mget'].' gc-'.$qc['gc']);
			BLog::addToLog('[Router]: Outputing the template...');
			}
		echo($tpl_str);
		BLog::addToLog('[Router]: All done!');
		if(!empty($this->htmllogger)){
			$this->htmllogger->print_html();
			}
		}
866496
public function generate()
    {
        $this->fill();
        $content = [];
        foreach ($this->_cells as $item) {
            $content[] = $item->generate();
        }
        //return implode('', $content);
        return Html::tag('div', implode('', $content), $this->htmlOptions);
    }
1169232
public function toHtml()
    {
        $this->setMeta("class", "vf__notes");

        $this->setConditionalMeta();
        $strOutput = "<div{$this->__getMetaString()}>\n";

        if (! empty($this->__header)) {
            $strOutput .= "<h4{$this->__getLabelMetaString()}>$this->__header</h4>\n";
        }

        if (! empty($this->__body)) {
            if (preg_match("/<p.*?>/", $this->__body) > 0) {
                $strOutput .= "{$this->__body}\n";
            } else {
                $strOutput .= "<p>{$this->__body}</p>\n";
            }
        }
        $strOutput .= "</div>\n";

        return $strOutput;
    }
619436
protected function _toHtml() {
        if ($this->_fixMessages()) {
            if ($this->_shouldUseInjection()) {
                $html = $this->renderView();
            } else {
                $this->_loadMessages();
                $this->_loadSavedMessages();
                if (count($this->getMessages())) {
                    $html = $this->_real_toHtml();
                } else {
                    // Prevent returning an empty <ul></ul>
                    $html = '';
                }
            }
        } else {
            $html = $this->_real_toHtml();
        }
        $this->_directCall = false;
        return $html;
    }
131469
public function toHtml()
	{
		$html = '';
		
		// if this group isn't a destination
		if ( ! $this->isDestination()) {
			// set the first element's "old" style to the group's style
			$oldStyle = $this->style;
			
			// define a flag indicating whether or not this group is the root group
			//
			// setting this flag here feel a little hackish!
			// however, the first element in the first group is different than the first
			//     element in any other group
			//
			$isFirstGroup = empty($this->parent);
			
			// a flag indicating whether or not the element is the first "textual" element
			//     in the group (i.e., control word with a special symbol, an actual text
			//     element, etc)
			//
			$isFirstTextualElement = true;
			
			// loop through the group's children
			foreach ($this->children as $child) {
				// if the child is a textual element
				$string = $child->format('html');
				if ( ! empty($string)) {
					// get the child's style
					$newStyle = $child->getStyle();
					// if the child is the first textual element in the first (aka, "root") group
					if ($isFirstGroup && $isFirstTextualElement) {
						// open the document's first section, paragraph, and character tags
						$html .= '<section style="'.$newStyle->getSection()->format('css').'">'
							 . '<p style="'.$newStyle->getParagraph()->format('css').'">'
							 . '<span style="'.$newStyle->getCharacter()->format('css').'">';
						// set the flag to false
						$isFirstTextualElement = false;
					} else {
						// otherwise, the child is not the first textual element in the root group 
						//    and we only close and open the section, paragraph, and character tags
						//    if the style has changed between elements
						//
						// keep in mind, a section takes precedence over a paragraph and a character;
						//     a paragraph takes precedence over a character; so on and so forth
						//
						if ($oldStyle->getSection() != $newStyle->getSection()) {
							$html .= '</span></p></section>'
								. '<section style="'.$newStyle->getSection()->format('css').'">'
								. '<p style="'.$newStyle->getParagraph()->format('css').'">'
								. '<span style="'.$newStyle->getCharacter()->format('css').'">';
						} elseif ($oldStyle->getParagraph() != $newStyle->getParagraph()) {
							$html .= '</span></p>'
								. '<p style="'.$newStyle->getParagraph()->format('css').'">'
								. '<span style="'.$newStyle->getCharacter()->format('css').'">';
						} elseif ($oldStyle->getCharacter() != $newStyle->getCharacter()) {
							$html .= '</span>'
								. '<span style="'.$newStyle->getCharacter()->format('css').'">';
						}
					}
					
					// append the html string
					$html .= $string;
					
					// set the "old" style to the current element's style for the next iteration
					$oldStyle = $newStyle;
				}
			}
		}
		
		return $html;
	}
890383
public function html()
    {
        return $this->builder()
                    ->columns($this->getColumns())
                    ->postAjax()
                    ->parameters($this->getBuilderParameters());
    }
1021577
public function html()
    {
        if (!$this->nodes) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }

        $html = '';
        foreach ($this->getNode(0)->childNodes as $child) {
            $html .= $child->ownerDocument->saveHTML($child);
        }

        return $html;
    }
860396
public function _toHtml()
    {
        $html = '';

        foreach ($this->getChildNames() as $childName) {
            if ($html === '') {
                $renderer = $this->getChildBlock($childName);
                $html = $renderer->render($this->getFilter());
            }
        }

        return $html;
    }
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;
  }
993562
function toHtml(){
        global $PAGE;

        // Enhance the select with javascript.
        $this->_generateId();
        $id = $this->getAttribute('id');

        if (!$this->isFrozen()) {
            $PAGE->requires->js_call_amd('core/form-autocomplete', 'enhance', $params = array('#' . $id, $this->tags, $this->ajax,
                $this->placeholder, $this->casesensitive, $this->showsuggestions, $this->noselectionstring));
        }

        $html = parent::toHTML();

        // Hacky bodge to add in the HTML code to the option tag. There is a nicer
        // version of this code in the new template version (see export_for_template).
        if ($this->valuehtmlcallback) {
            $html = preg_replace_callback('~value="([^"]+)"~', function($matches) {
                $value = html_entity_decode($matches[1]);
                $htmlvalue = call_user_func($this->valuehtmlcallback, $value);
                if ($htmlvalue !== false) {
                    return $matches[0] . ' data-html="' . s($htmlvalue) . '"';
                } else {
                    return $matches[0];
                }
            }, $html);
        }

        return $html;
    }
864467
protected function _toHtml()
    {
        if (!$this->getOptions()) {
            $cmsPages = $this->cmsPageCollection->addStoreFilter($this->getStoreFromContext());
            foreach ($cmsPages as $cmsPage) {
                /** @var \Magento\Cms\Model\Page $cmsPage */
                $this->addOption($cmsPage->getId(), $cmsPage->getTitle());
            }
        }

        return parent::_toHtml();
    }
358850
function toHtml()
    {
        if ($this->_flagFrozen) {
            return parent::toHtml();
        } else {
            return '<input' . $this->_getAttrString(array(
                        'type'  => 'hidden',
                        'name'  => $this->getName(),
                        'value' => $this->_values[0]
                   )) . ' />' . parent::toHtml();

        }
    }
636977
public function buildHtml()
	{
		$list	= array();
		$divs	= array();
		foreach( $this->steps as $nr => $step )
		{
			$id		= $this->id."_link".$nr;
			$list[]	= UI_HTML_Elements::ListItem( $step['label'], 0, array( 'id' => $id ) );
			$id		= $this->id."_".$nr;
			$divs[] = UI_HTML_Tag::create( 'div', $step['content'], array( 'id' => $id ) );
		}
		$list	= UI_HTML_Elements::unorderedList( $list );
		$divs	= implode( "\n", $divs );
		$div	= UI_HTML_Tag::create( 'div', "\n".$list.$divs."\n", array( 'id' => $this->id ) );
		return $div;
	}
1107532
public function toHtml() {

        // Add the class at the last minute.
        if ($this->get_force_ltr()) {
            if (!isset($this->_attributes['class'])) {
                $this->_attributes['class'] = 'text-ltr';
            } else {
                $this->_attributes['class'] .= ' text-ltr';
            }
        }

        $this->_generateId();
        if ($this->_flagFrozen) {
            return $this->getFrozenHtml();
        }
        $html = $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />';

        if ($this->_hiddenLabel){
            return '<label class="accesshide" for="'.$this->getAttribute('id').'" >'.
                        $this->getLabel() . '</label>' . $html;
        } else {
             return $html;
        }
    }
929039
function toHtml()
    {
        $this->_generateId(); // Seems to be necessary when this is used in a group.
        if (0 == strlen($this->_text)) {
            $label = '';
        } elseif ($this->_flagFrozen) {
            $label = $this->_text;
        } else {
            $label = '<label for="' . $this->getAttribute('id') . '">' . $this->_text . '</label>';
        }
        return HTML_QuickForm_input::toHtml() . $label;
    }