Label::render

Rendering labeled string.

@return string
977311
public function render()
    {
        // if the string of label is empty then nothing to be processed.
        if (empty($this->string)) {
            return '';
        }

        $string = str_repeat(' ', 2) . $this->string . str_repeat(' ', 2);

        switch ($this->contextualClass) {
            default:
                $output = $string;
                break;
            case 'primary':
                $output = str_repeat(' ', $this->indent) . "\033[1;37m" . "\033[44m" . str_repeat(
                        ' ',
                        strlen($string)
                    ) . "\033[0m" . "\r\n";
                $output .= str_repeat(
                        ' ',
                        $this->indent
                    ) . "\033[1;37m" . "\033[44m" . $string . "\033[0m" . "\r\n";
                $output .= str_repeat(' ', $this->indent) . "\033[1;37m" . "\033[44m" . str_repeat(
                        ' ',
                        strlen($string)
                    ) . "\033[0m";
                break;
            case 'success':
                $output = str_repeat(' ', $this->indent) . "\033[1;37m" . "\033[42m" . str_repeat(
                        ' ',
                        strlen($string)
                    ) . "\033[0m" . "\r\n";
                $output .= str_repeat(
                        ' ',
                        $this->indent
                    ) . "\033[1;37m" . "\033[42m" . $string . "\033[0m" . "\r\n";
                $output .= str_repeat(' ', $this->indent) . "\033[1;37m" . "\033[42m" . str_repeat(
                        ' ',
                        strlen($string)
                    ) . "\033[0m";
                break;
            case 'info':
                $output = str_repeat(' ', $this->indent) . "\033[1;37m" . "\033[46m" . str_repeat(
                        ' ',
                        strlen($string)
                    ) . "\033[0m" . "\r\n";
                $output .= str_repeat(
                        ' ',
                        $this->indent
                    ) . "\033[1;37m" . "\033[46m" . $string . "\033[0m" . "\r\n";
                $output .= str_repeat(' ', $this->indent) . "\033[1;37m" . "\033[46m" . str_repeat(
                        ' ',
                        strlen($string)
                    ) . "\033[0m";
                break;
            case 'warning':
                $output = str_repeat(' ', $this->indent) . "\033[1;37m" . "\033[43m" . str_repeat(
                        ' ',
                        strlen($string)
                    ) . "\033[0m" . "\r\n";
                $output .= str_repeat(
                        ' ',
                        $this->indent
                    ) . "\033[1;37m" . "\033[43m" . $string . "\033[0m" . "\r\n";
                $output .= str_repeat(' ', $this->indent) . "\033[1;37m" . "\033[43m" . str_repeat(
                        ' ',
                        strlen($string)
                    ) . "\033[0m";
                break;
            case 'danger':
                $output = str_repeat(' ', $this->indent) . "\033[1;37m" . "\033[41m" .
                    str_repeat(' ', strlen($string)) . "\033[0m" . "\r\n";
                $output .= str_repeat(
                        ' ',
                        $this->indent
                    ) . "\033[1;37m" . "\033[41m" . $string . "\033[0m" . "\r\n";
                $output .= str_repeat(' ', $this->indent) . "\033[1;37m" . "\033[41m" .
                    str_repeat(' ', strlen($string)) . "\033[0m";
                break;
        }

        return str_repeat(PHP_EOL, $this->newLinesBefore) . $output . str_repeat(PHP_EOL, $this->newLinesAfter);
    }
1223646
public function render(): string
	{
		$targetUrl = Escaper::htmlEntityEncode(self::buildUrl());

		if ($this->buttonStyle === null) {
			return "<a href=\"{$targetUrl}\">{$this->buttonText}</a>";
		}

		$gateUrl = $this->payment->getMerchantConfig()->gateUrl;

		$buttonStyle = rawurlencode($this->buttonStyle);
		$src = Escaper::htmlEntityEncode($gateUrl . 'buttons/' . $buttonStyle . '.png');
		$title = Escaper::htmlEntityEncode($this->buttonText);

		return "<a href=\"{$targetUrl}\"><img src=\"{$src}\" alt=\"{$title}\" title=\"{$title}\" /></a>";
	}
805782
protected function render() : string
    {
        $html = '<div class="jumbotron' .
            (($this->fluid === true) ? ' jumbotron-fluid' : null) .
            (($this->bg_color !== null) ? ' bg-' . $this->bg_color : null) .
            (($this->text_color !== null) ? ' text-' . $this->text_color : null) .
            '">' .
            (($this->fluid === true) ? '<div class="container">' : null) .
            '<h1 class="display-' . (($this->display_level !== null) ? $this->display_level : '1') .
            '">' . $this->heading .
            (($this->sub_heading !== null) ? ' <small>' .
            $this->sub_heading . '</small>' : null) .
            '</h1>' . $this->content .
            (($this->fluid === true) ? '</div>' : null) .
            '</div>';

        return $html;
    }
932031
public function renderAttributes() : string
    {
        $pairs = array_map(function(string $value, string $key) {
            return sprintf('%s="%s"', helpers\e($key), helpers\e($value));
        }, $this->attributes, array_keys($this->attributes));

        return implode(' ', $pairs);
    }
1347515
protected function render(): string
    {
        switch ($this->mode) {
            case 'button':
                $html = '<button class="btn' . $this->classes() . '" type="submit"' .
                    (($this->disabled === true) ? ' disabled' : null) .
                    '>' . $this->label . '</button>';
                break;

            case 'input':
                $html = '<input class="btn' . $this->classes() . '" type="' .
                    $this->input_type . '" value="' .
                    $this->label . '" ' .
                    (($this->disabled === true) ? ' disabled ' : null) . '/>';
                break;

            default:
                $html = '<a href="' . (($this->uri !== null) ? $this->uri : '#') .
                    '" class="btn' . $this->classes() .
                    (($this->disabled === true) ? ' disabled' : null) .
                    '" role="button">' . $this->label . '</a>';
                break;
        }

        return $html;
    }
464758
private function render() : string
    {
        $html = '<div class="jumbotron">' .
            (($this->fluid === true) ? '<div class="container">' : null) .
            '<h1>' . $this->view->escapeHtml($this->heading) .
            (($this->sub_heading !== null) ? '<small>' .
            $this->view->escapeHtml($this->sub_heading) . '</small>' : null) .
            '</h1>' . $this->content .
            (($this->fluid === true) ? '</div>' : null) .
            '</div>';

        return $html;
    }
694169
public function render()
    {
        if (!$this->checkAnsiAwareSystem()) {
            return $this->str;
        }

        if ($this->has_tags) {
            return $this->tag_format->parse($this->str);
        } elseif (!empty($this->str)) {
            $this->output->useEffect($this->format);
            return $this->output->build();
        }

        return $this->str;
    }
1151783
public function render() {

		$result = NULL;

		foreach ($this->css as $name => $value) {

			if (!$value = trim($value)) {
				continue;
			}

			$result .= "{$name}:{$value};";
		}

		return $result ? $result : '';
	}
807481
public function RenderLabel () {
		if ($this->renderMode == \MvcCore\Ext\Forms\IForm::FIELD_RENDER_MODE_NO_LABEL) 
			return '';
		$attrsStr = $this->renderAttrsWithFieldVars(
			['multiple'], $this->groupLabelAttrs, $this->groupLabelCssClasses, FALSE
		);
		$viewClass = $this->form->GetViewClass();
		/** @var $templates \stdClass */
		$templates = & static::$templates;
		return $viewClass::Format($templates->label, [
			'id'		=> $this->id,
			'label'		=> $this->label,
			'attrs'		=> $attrsStr ? " $attrsStr" : '',
		]);
	}
695917
public function render()
    {
        if (empty($this->string)) {
            return '';
        }

        $string = str_repeat(' ', $this->indent) . $this->string . str_repeat(' ', $this->space);

        return $this->color->paint($string);
    }
209834
public function render(): string
    {
        $output = '';

        if ($this->token === null) {
            $output .= $this->counter . ". ";
        } else {
            $output .= $this->token;
        }

        if ($this->hasChildren() === true) {
            foreach ($this->children() as $child) {
                $output .= $child->render();
            }
        }

        $output .= $this->escape($this->insert);

        return $output;
    }
1013668
public function render()
	{
		$attributes	= $this->getAttributes();
		if( is_array( $attributes['href'] ) )
			$attributes['href']	= ADT_URL_Inference::buildStatic( $attributes['href'] );
		$content	= $this->renderInner( $this->content );
		if( !is_string( $content ) )
			throw new InvalidArgumentException( 'Link label is neither rendered nor renderable' );
		return UI_HTML_Tag::create( "a", $content, $attributes );	
	}
124120
function render()
    {
        $label = $this->getLabel();
        if ( empty($label) )
            throw new \Exception('Header label is empty.');

        return $label.': '.$this->renderValueLine().self::CRLF;
    }
55820
public function render()
    {
        $returnValue = $this->renderLabel();
        
        $returnValue .= "<select name='{$this->name}' id='{$this->name}' ";
        $returnValue .= $this->renderAttributes();
        $returnValue .= ">";
        if (! empty($this->emptyOption)) {
            $this->options = array_merge(array(
                ' ' => $this->emptyOption), $this->options);
        }
        foreach ($this->options as $optionId => $optionLabel) {
            $returnValue .= "<option value='{$optionId}' ";
            if ($this->value === $optionId) {
                $returnValue .= " selected='selected' ";
            }
            $returnValue .= ">" . _dh($optionLabel) . "</option>";
        }
        $returnValue .= "</select>";
        
        return (string) $returnValue;
    }
593985
public function render()
    {
        if ($this->isVoid) {
            return $this->renderTag();
        }

        $content = '';

        if ($this->hasChildren()) {
            $content = $this->renderChildren();
        }

        if ('append' === $this->contentConcat) {
            $content .= $this->getContent();
        } else {
            $content = $this->getContent() . $content;
        }

        return $this->renderTag($content);
    }
912443
public function label() {
		$output = null;
		if ( ! empty( $this->struct['label'] ) ) {
			$output .= '<span class="uix-text">' . esc_html( $this->struct['label'] ) . '</span>';
		}

		return $output;
	}
1060318
private function renderSingleValue($label, $args, $maxLength = null)
    {
        // BC: sometimes the label was returned as string in the arguments instead of an array.
        $string = !\is_array($args) ? $args : \vsprintf($label, $args);

        if ((null !== $maxLength) && \strlen($string) > $maxLength) {
            $string = \substr($string, 0, $maxLength);
        }

        return $string;
    }