Render label

@param  string $content The content text
@param  string $type    Label type
@return string
491595
public function render($content, $type = '')
    {
        // Check variables
        $this->checkContent($content);
        if (!$type) {
            if ($this->defaultType !== false) {
                $type = $this->defaultType;
            }
        }
        $this->setType($type);

        // Render html
        return $this->renderElement($content);
    }
916649
private function render($content, array $attributes = []): string
    {
        $template = $attributes[$this->attributeName] ?? '';

        return $this->environment->render($template, ['content' => $content]);
    }
276379
private function renderColumnSeparator($type = self::BORDER_OUTSIDE)
    {
        $borders = $this->style->getBorderChars();

        return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]);
    }
388294
public function addScriptDeclaration($content, $type = 'text/javascript')
	{
		if (!isset($this->_script[strtolower($type)]))
		{
			$this->_script[strtolower($type)] = array($content);
		}
		else
		{
			$this->_script[strtolower($type)][] = chr(13) . $content;
		}

		return $this;
	}
629218
protected function _renderTag($attribs = array(), $content = null, TemplateInterface $template)
    {
        $result = '';
        $link   = isset($attribs['src']) ? $attribs['src'] : false;

        if($link)
        {
            $url        = $this->getObject('lib:http.url', array('url' => $link));
            $identifier = $this->getIdentifier($url->toString(HttpUrl::BASE));

            //Include the component
            $result = $this->getObject('com:'.$identifier->package.'.dispatcher.fragment')
                ->include($url);

            if($this->getObject('template.engine.factory')->isDebug())
            {
                $format  = PHP_EOL.'<!--BEGIN ktml:include '.$url.' -->'.PHP_EOL;
                $format .= '%s';
                $format .= PHP_EOL.'<!--END ktml:include '.$url.' -->'.PHP_EOL;

                $result = sprintf($format, trim($result));
            }
        }

        return $result;
    }
665749
public function url($type, $content = null)
    {
        $type       = trim($type, '/');
        $predefined = ['posts', 'rss', 'archives'];

        if (in_array($type, $predefined)) {
            return handles("orchestra/story::{$type}");
        }

        return $this->permalink($type, $content);
    }
1107983
public function getHtml($type = self::NO_SINGLE_RENDER_TYPE) {
        $this->_singleRenderType = $type;
        return $this->_handleDirectCall('getHtml')->toHtml();
    }
308786
public function renderType($type, $changes)
	{
		$content = '';

		if (count($changes) > 0)
		{
			$content = "### $type\n" .
				'- ' . implode("\n- ", $changes) . "\n";
		}

		return $content . "\n";
	}
238998
public function field( $type, array $attributes = array(), $contents = null )
    {
        $_html = null;
        $_type = strtolower( trim( $type ) );
        $_wrapInput = Scalar::in( $_type, 'checkbox', 'radio' );
        $_labelEnd = null;
        $_labelAttributes = array();
        $_id = Option::get( $attributes, 'id', Option::get( $attributes, 'name' ) );
        $_inputAppend = Option::get( $attributes, 'append', null, true );
        $_inputPrepend = Option::get( $attributes, 'prepend', null, true );

        $this->cleanNames( $attributes );

        $_label = Option::get( $attributes, 'label', null, true );

        if ( is_array( $_label ) )
        {
            $_labelAttributes = Option::get( $_label, 'attributes', array() );
            $_labelText = Option::get( $_label, 'value', array() );
        }
        else
        {
            $_labelText = $_label;
        }

        //	Add .control-label for the class to labels
        if ( static::Horizontal == $this->_formType )
        {
            if ( !isset( $_labelAttributes['class'] ) )
            {
                $_labelAttributes['class'] = null;
            }

            $_labelAttributes['class'] = static::addValue( $_labelAttributes['class'], ( $_wrapInput ? $_type : 'control-label' ) );
        }

        $_label = static::tag( 'label', $_labelAttributes, ( $_wrapInput ? null : $_labelText ), !$_wrapInput );
        $_labelEnd = ( $_wrapInput ? $_label . '</label>' : null );

        if ( null !== ( $_hint = Option::get( $attributes, 'hint', null, true ) ) )
        {
            $_hint = static::tag( 'span', array('class' => 'help-block'), $_hint );
        }

        $_blockStart = $_blockEnd = null;
        $_inputStart = $_inputEnd = null;
        $_inputWrap = trim( ( $_inputAppend ? 'input-append' : null ) . ' ' . ( $_inputPrepend ? 'input-prepend' : null ) );

        switch ( $this->_formType )
        {
            case static::Horizontal:

                $_blockStart = static::tag( 'div', array('class' => 'control-group'), null, false );
                $_inputStart = static::tag( 'div', array('class' => 'controls'), null, false );
                $_inputEnd = $_blockEnd = '</div>';

                if ( !$_wrapInput )
                {
                    $_blockStart .= $_label . $_labelEnd;
                    $_label = $_labelEnd = null;
                }
                break;

            case static::Search:
                $_class = Option::get( $attributes, 'class' );
                $attributes['class'] = static::addValue( $_class, 'search-query' );
                break;
        }

        if ( null === $contents && !empty( $this->_formData ) )
        {
            $contents = Option::get( $this->_formData, $_id );
        }

        //	X-editable?
        if ( false !== stripos( Option::get( $attributes, 'class' ), 'x-editable' ) )
        {
            //	Replace contents with the x-editable link...
            $contents = static::tag(
                'a',
                array(
                    'class'               => 'x-editable',
                    'href'                => '#',
                    'id'                  => $_id,
                    'data-type'           => $_type,
                    'data-pk'             => Option::get( $this->_attributes, 'x-editable-pk', Option::get( $this->_formData, 'id' ) ),
                    'data-url'            => Option::get(
                        $this->_attributes,
                        'x-editable-url',
                        Option::get( $attributes, 'x-editable-url', null, true )
                    ),
                    'data-original-title' => $_labelText,
                    'data-inputclass'     => Option::get( $attributes, 'class', 'input-xlarge' ),
                ),
                $contents
            );

            //	New type of just HTML...
            $_type = 'html';
        }

        switch ( $_type )
        {
            case 'html':
                $_input = $contents;
                break;

            case 'textarea':
                $attributes['class'] = static::addValue( Option::get( $attributes, 'class' ), 'input-xxlarge' );

                $_input = static::wrap(
                    $_type,
                    $contents,
                    $attributes
                );
                break;

            case 'select':
                if ( !isset( $attributes['value'] ) )
                {
                    $attributes['value'] = $contents;
                }

                $_input = static::select(
                    Option::get( $attributes, 'data', array(), true ),
                    $attributes
                );
                break;

            case 'button':
                $_input = static::button( $attributes, $contents );
                break;

            default:
                $_input = $this->_handleUnknownField( $_type, $attributes, $contents );
                break;
        }

        if ( !empty( $_inputWrap ) )
        {
            $_input = '<div class="' . $_inputWrap . '">' . $_inputPrepend . $_input . $_inputAppend . '</div>';
        }

        $_html = <<<HTML
{$_blockStart}{$_inputStart}{$_label}{$_input}{$_labelEnd}{$_hint}{$_inputEnd}{$_blockEnd}
HTML;

        if ( false !== $this->_builderMode )
        {
            $this->_contents .= $_html;
        }

        return $_html;
    }
17419
def render_label(content, label_for=None, label_class=None, label_title=""):
    
    attrs = {}
    if label_for:
        attrs["for"] = label_for
    if label_class:
        attrs["class"] = label_class
    if label_title:
        attrs["title"] = label_title
    return render_tag("label", attrs=attrs, content=content)
861142
public function highlight($content)
	{
		$this->registerClientScript();

		$options['use_language']=true;
		$options['tabsize']=$this->tabSize;
		if($this->showLineNumbers)
			$options['numbers']=($this->lineNumberStyle==='list')?HL_NUMBERS_LI:HL_NUMBERS_TABLE;

		$highlighter=empty($this->language)?false:Text_Highlighter::factory($this->language);
		if($highlighter===false)
			$o='<pre>'.CHtml::encode($content).'</pre>';
		else
		{
			$highlighter->setRenderer(new Text_Highlighter_Renderer_Html($options));
			$o=preg_replace('/<span\s+[^>]*>(\s*)<\/span>/','\1',$highlighter->highlight($content));
		}

		return CHtml::tag('div',$this->containerOptions,$o);
	}
940596
public static function create($type, $content)
	{
		if (empty($type)) {
			throw new AlertTypeException('Unable to create message with invalid type.');
		}

		if (empty($content)) {
			throw new AlertContentException('Unable to create message with invalid content.');
		}

		return new self($type, $content);
	}
1056488
public function createPlaintextReport($content)
    {
        $report = ' indexing report' . "\n\n";
        $report .= 'Finishing time: ' . date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ', H:i') . "\n\n";
        $report .= preg_replace('~[ ]{2,}~', '', strip_tags($content));
        $report .= "\n\n" . 'Indexing process ran ' . $this->calculateAndFormatIndexingTime();

        return $report;
    }
1192788
public function render($content = null)
    {
        if (method_exists($this, 'seed')) {
            $this->append('seed', $this->seed()->all());
        }

        return view("{$this->namespace}{$this->template}", $content ? : $this->content);
    }
857501
public function renderRow($content, $type = null, $label = null, array $options = [])
    {
        $compound = false;

        if ($type == 'checkbox') {
            $content = $this->renderCheckboxWidget($content, $options);
        } elseif ($type == 'number') {
            $content = $this->renderNumberWidget($content, $options);
        } elseif ($type == 'textarea') {
            $content = $this->renderTextareaWidget($content, $options);
        } elseif ($type == 'entity') {
            $content = $this->renderEntityWidget($content, $options);
        } elseif ($type == 'url') {
            $content = $this->renderUrlWidget($content, $options);
        } elseif ($type == 'datetime' || $type == 'date') {
            if ($type == 'date') {
                $options['time'] = false;
            }
            $content = $this->renderDatetimeWidget($content, $options);
        } elseif ($type == 'tel') {
            $content = $this->renderTelWidget($content, $options);
        } elseif ($type == 'color') {
            $content = $this->renderColorWidget($content, $options);
        } elseif ($type == 'tinymce') {
            $content = $this->renderTinymceWidget($content, $options);
        } elseif ($type == 'upload') {
            $content = $this->renderUploadWidget($content, $options);
        } elseif ($type == 'media') {
            $content = $this->renderMediaWidget($content, $options);
        } elseif ($type == 'medias') {
            $content = $this->renderMediasWidget($content, $options);
        } elseif ($type == 'seo') {
            $content = $this->renderSeoWidget($content, $options);
        } elseif ($type == 'key_value_collection') {
            $content = $this->renderKeyValueCollectionWidget($content, $options);
        } elseif ($type == 'coordinate') {
            $content = $this->renderCoordinateWidget($content, $options);
        } else {
            $content = $this->renderSimpleWidget($content, $options);
        }

        $vars = [
            'label' => $label !== null ? $label : false,
            'content' => $content,
            'compound' => $compound
        ];

        /* Fix boostrap columns */
        $vars['label_nb_col'] = isset($options['label_nb_col']) ? intval($options['label_nb_col']) : (strlen($label) > 0 ? 2 : 0);
        $vars['nb_col'] = isset($options['nb_col']) ? intval($options['nb_col']) : 12 - $vars['label_nb_col'];

        return $this->renderBlock('show_row', $vars);
    }
6181
public function addMessage($type, $content)
	{
		if($this->session->has('Cfmessage')) {
			$messages = $this->session->get('Cfmessage', []);
		}
		
		$messages[] = [
			'content' => $content,
			'type' => $type,
		];
		
		$this->session->set('Cfmessage', $messages);
	}
427645
protected function renderTag($content = null)
    {
        $attributes = $this->renderAttributes();

        if ($this->isVoid) {
            return sprintf(
                '<%1$s%2$s%3$s>',
                $this->tag,
                $attributes,
                $this->isXhtml ? ' /' : ''
            );
        }

        return sprintf(
            '<%1$s%2$s>%3$s</%1$s>',
            $this->tag,
            $attributes,
            $content
        );
    }