Render control wrapper

@param  string           $id
@param  ElementInterface $element
@param  string           $elementString
@param  string           $description
@param  string           $wrapper
@return string
506715
protected function renderControlWrapper($id, $element, $elementString, $description, $wrapper = null)
    {
        if (!$wrapper) {
            if ($element instanceof ButtonElement || $element instanceof SubmitElement) {
                return $elementString . $description;
            }
            $wrapper = $this->controlWrapper;
        }
        return sprintf($wrapper, $id, $elementString, $description);
    }
799666
protected function _elementTpl($name, $value = '', $id = '', $text = '', array $attrs = array())
    {
        $alias    = Str::slug($value, true);
        $inpClass = $this->_jbSrt('val-' . $alias);
        $input    = $this->input($name, $value, $id, $inpClass, $attrs);

        if ($this->_tpl === 'default') {
            return $input . $this->label($id, $alias, $text);
        } elseif ($this->_tpl === 'wrap') {
            return $this->label($id, $alias, $input . ' ' . $text);
        }

        if (is_callable($this->_tpl)) {
            return call_user_func($this->_tpl, $this, $name, $value, $id, $text, $attrs);
        }

        return null;
    }
329245
public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer)
    {
        // This can't be in the method type as
        // the method is an abstract and should
        // have the same interface
        if (!$inline instanceof Link) {
            throw new \RuntimeException(
                'Wrong type passed to ' . __CLASS__ . '::' . __METHOD__ .
                " the expected type was 'League\\CommonMark\\Inline\\Element\\Link' but '" .
                get_class($inline) . "' was provided"
            );
        }

        // Default handling
        $element = parent::render($inline, $htmlRenderer);

        $url = $inline->getUrl();

        // empty urls, anchors and absolute urls
        // should not go through the url resolver
        if (!$this->isValidUrl($url) || $this->isExternalUrl($url)) {
            return $element;
        }

        //Internal links
        $file = $this->resolveInternalFile($url);

        $link_props = [
            'ri:content-title' => trim(trim($this->daux['confluence']['prefix']) . ' ' . $file->getTitle()),
            'ri:space-key' => $this->daux['confluence']['space_id'],
        ];

        $page = strval(new HtmlElement('ri:page', $link_props, '', true));
        $children = $htmlRenderer->renderInlines($inline->children());
        if (strpos($children, '<') !== false) {
            $children = '<ac:link-body>' . $children . '</ac:link-body>';
        } else {
            $children = '<ac:plain-text-link-body><![CDATA[' . $children . ']]></ac:plain-text-link-body>';
        }

        return new HtmlElement('ac:link', [], $page . $children);
    }
368267
private function renderElement(Element $element) : string
    {
        $label = $element->getLabel();

        if ($label->isEmpty()) {
            return $element->render();
        }

        return $label->render() . $element->render();
    }
182427
public function render(ElementInterface $element, $groupWrapper = null, $controlWrapper = null)
    {
        $renderer = $this->getElementHelper()->getView();
        if (method_exists($renderer, 'plugin') && $element instanceof RadioElement) {
            $renderer->plugin('form_radio')->setLabelAttributes([
                'class' => 'radio',
            ]);
        }

        $elementString = $this->getElementHelper()->render($element);
        if ($this->renderErrors) {
            $elementString .= $this->getElementErrorsHelper()->render($element);
        }
        if ($element->getAttribute('type') === 'hidden') {
            return $elementString;
        }

        return $this->renderGroup($element, $elementString, $groupWrapper, $controlWrapper);
    }
1134667
private void renderDescription(CmsTabInfo tabInfo, Panel descriptionParent) {

        if (tabInfo.getDescription() != null) {
            HTML descriptionLabel = new HTML();
            descriptionLabel.addStyleName(I_CmsLayoutBundle.INSTANCE.form().tabDescription());
            if (!tabInfo.getDescription().startsWith("<div")) {
                // add default styling in case of simple HTML
                descriptionLabel.addStyleName(I_CmsLayoutBundle.INSTANCE.form().tabDescriptionPanel());
            }
            descriptionLabel.setHTML(tabInfo.getDescription());
            descriptionParent.add(descriptionLabel);
        }
    }
301469
public function xmlRenderer(array $response, string $firstelem, string $name = null): Renderer
    {
        $xmlElem = new \SimpleXMLElement("<?xml version=\"1.0\"  encoding=\"UTF-8\" ?><$firstelem></$firstelem>");
        $this->buildXml($response, $xmlElem);
        libxml_use_internal_errors(true);
        $feed = new \DOMDocument();
        $feed->preserveWhitespace = true;
        $result = dom_import_simplexml($xmlElem);
        if (!$result) {
            throw new Server500(new \ArrayObject(array("explain" => "Renderer: xml element is invalid.".
                ((isset(error_get_last()["message"])? " : ".error_get_last()["message"] : "" )), "solution" =>
                "Please send a valid xml element to renderer")));
        }

        $dom = dom_import_simplexml($xmlElem)->ownerDocument;
        $dom->formatOutput = true;
        $xml_file = $dom->saveXML();
        if ($xml_file) {
            $this->display_elements = array("xml" => $xml_file, "name" => $name);
        } else {
            throw new Server500(new \ArrayObject(array("explain" => "Renderer: xml element is invalid.", "solution" =>
                "Please send a valid xml element to renderer")));
        }
        return ($this);
    }
402459
public function render(ElementInterface $element)
    {
        $labelHelper = $this->getLabelHelper();
        $elementHelper = $this->getElementHelper();
        $elementErrorsHelper = $this->getElementErrorsHelper();
        $type = $element->getAttribute('type');

        if($type == 'button' || $type == 'submit') {
            $label = $this->getElementLabel($element);
            $element->setValue($label);
        }

        if ($this->renderErrors) {
            $elementErrors = $elementErrorsHelper->render($element, ['class' => 'form-errors col-xs-6 col-md-7 col-md-offset-5 col-lg-8 col-lg-offset-4']);
        }


        $elementString = $elementHelper->render($element);
        $controlElementWrapperClass = 'col-xs-7 col-md-8 col-lg-9';

        if($element instanceof \Zend\Form\Element\DateSelect) {
            $controlElementWrapperClass .= ' form-inline';
        }

        if ($type !== 'hidden') {

            if ($type === 'multi_checkbox' || $type === 'radio' || $element instanceof \Zend\Form\Element\MonthSelect) {

                $element->setLabelAttributes(['class' => 'col-lg-3 col-xs-5 col-md-4 control-label']);
                $markup = $labelHelper($element) . '<div class="' . $controlElementWrapperClass . '">
                    <div class="btn-group" data-toggle="buttons">' . $elementString . '</div></div>';

            } elseif($type == 'button' || $type == 'submit') {
                $markup = '<div class="' . $controlElementWrapperClass . ' col-md-offset-4 col-lg-offset-3">' . $elementString . '</div>';
            } else {
                switch ($this->labelPosition) {
                    case self::LABEL_APPEND:
                        $element->setLabelAttributes(['class' => 'col-lg-3 col-xs-5 col-md-4 control-label']);
                        $markup = '<div class="' . $controlElementWrapperClass . '">' . $elementString . '</div>' . $labelHelper($element);
                        break;
                    case self::LABEL_PREPEND:
                    default:
                        $element->setLabelAttributes(['class' => 'col-lg-3 col-xs-5 col-md-4 control-label']);
                        $markup = $labelHelper($element) . '<div class="' . $controlElementWrapperClass . '">' . $elementString . '</div>';
                        break;
                }
            }

            $rowClass = 'form-group col-lg-12 col-md-12 col-xs-12';
            if ($this->renderErrors && !empty($elementErrors)) {
                $markup .= $elementErrors;
                $rowClass .= ' has-error';
            }
            $markup = '<div class="row"><div class="' . $rowClass . '">' . $markup . '</div></div>';
        } else {
            if ($this->renderErrors) {
                $markup = $elementString . $elementErrors;
            } else {
                $markup = $elementString;
            }
        }
        return $markup;
    }
1069662
public function render(ElementInterface $element)
    {
        $escapeHtmlHelper    = $this->getEscapeHtmlHelper();
        $labelHelper         = $this->getLabelHelper();
        $elementHelper       = $this->getElementHelper();
        $elementErrorsHelper = $this->getElementErrorsHelper();

        $label           = $element->getLabel();
        $inputErrorClass = $this->getInputErrorClass();
        $elementErrors   = $elementErrorsHelper->render($element);

        // Does this element have errors ?
        if (!empty($elementErrors) && !empty($inputErrorClass)) {
            $classAttributes = ($element->hasAttribute('class') ? $element->getAttribute('class') . ' ' : '');
            $classAttributes = $classAttributes . $inputErrorClass;

            $element->setAttribute('class', $classAttributes);
        }

        $elementString = $elementHelper->render($element);

        if (isset($label) && '' !== $label) {
            // Translate the label
            if (null !== ($translator = $this->getTranslator())) {
                $label = $translator->translate(
                    $label,
                    $this->getTranslatorTextDomain()
                );
            }

            $label = $escapeHtmlHelper($label);
            $labelAttributes = $element->getLabelAttributes();

            if (empty($labelAttributes)) {
                $labelAttributes = $this->labelAttributes;
            }

            // Multicheckbox elements have to be handled differently as the HTML standard does not allow nested
            // labels. The semantic way is to group them inside a fieldset
            $type = $element->getAttribute('type');
            if ($type === 'multi_checkbox' || $type === 'radio') {
                $markup = sprintf(
                    '<fieldset><legend>%s</legend>%s</fieldset>',
                    $label,
                    $elementString
                );
            } else {
                if ($element->hasAttribute('id')) {
                    $labelOpen = $labelHelper($element);
                    $labelClose = '';
                    $label = '';
                } else {
                    $labelOpen  = $labelHelper->openTag($labelAttributes);
                    $labelClose = $labelHelper->closeTag();
                }

                if ($label !== '') {
                    $label = '<span>' . $label . '</span>';
                }

                switch ($this->labelPosition) {
                    case self::LABEL_PREPEND:
                        $markup = $labelOpen . $label . $elementString . $labelClose;
                        break;
                    case self::LABEL_APPEND:
                    default:
                        $markup = $labelOpen . $elementString . $label . $labelClose;
                        break;
                }
            }

            if ($this->renderErrors) {
                //$markup .= $elementErrors;
            }
        } else {
            if ($this->renderErrors) {
                $markup = $elementString;  //. $elementErrors;
            } else {
                $markup = $elementString;
            }
        }

        return $markup;
    }
663252
function renderToString(element) {
  !React.isValidElement(element) ?  false ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : _prodInvariant('46') : void 0;
  return renderToStringImpl(element, false);
}
890759
public static function renderString( $string, $elements = array() )
	{
		$template	= new self();
		$template->template	= $string;
		$template->add( $elements );
		return $template->create();
	}
85322
public function render( ElementInterface $element )
    {
        if ( ! $element instanceof Properties )
        {
            throw new Exception\InvalidArgumentException( sprintf(
                '%s requires that the element is of type Grid\Customize\Form\Element\Properties',
                __METHOD__
            ) );
        }

        $name = $element->getName();
        if ( empty( $name ) && $name !== 0 )
        {
            throw new Exception\DomainException( sprintf(
                '%s requires that the element has an assigned name; none discovered',
                __METHOD__
            ) );
        }

        $attributes = $element->getAttributes();
        $value      = (array) $element->getValue();
        $addAttr    = array(
            'name'      => $name,
            'required'  => empty( $attributes['required'] ) ? null : 'required',
        );

        unset( $attributes['name'] );
        unset( $attributes['required'] );
        $this->validTagAttributes = $this->validContainerAttributes;
        return sprintf(
            '<dl %s>%s</dl>',
            $this->createAttributesString( $attributes ),
            $this->renderProperties( $value, $addAttr )
        );
    }
1280124
public function getInputHtml ($value, ElementInterface $element = null): string
	{
		if ($element !== null && $element->hasEagerLoadedElements($this->handle))
			$value = $element->getEagerLoadedElements($this->handle);

		/** @noinspection PhpComposerExtensionStubsInspection */
		return new Markup(
			$this->_renderMap($value),
			'utf-8'
		);
	}
838823
protected void renderId(
      FacesContext context,
      UIComponent  component) throws IOException
    {
      if (shouldRenderId(context, component))
      {
        String clientId = getClientId(context, component);
        context.getResponseWriter().writeAttribute(HTML.ID_ATTR, clientId, JSFAttr.ID_ATTR);
      }
    }
1343504
public function render(Document $reportDom, Config $config)
    {
        foreach ($reportDom->firstChild->query('./report') as $reportEl) {
            $title = $reportEl->getAttribute('title');

            if ($title) {
                $this->output->writeln(sprintf('<title>%s</title>', $title));
                $this->output->writeln(sprintf('<title>%s</title>', str_repeat('=', strlen($title))));
                $this->output->write(PHP_EOL);
            }

            foreach ($reportEl->query('./description') as $descriptionEl) {
                $this->output->writeln(sprintf('<description>%s</description>', $descriptionEl->nodeValue));
                $this->output->writeln('');
            }

            foreach ($reportEl->query('.//table') as $tableEl) {
                $this->output->writeln(sprintf('<subtitle>%s</subtitle>', $tableEl->getAttribute('title')));
                $this->renderTableElement($tableEl, $config);
            }
        }
    }
429096
public static function panel($text, $id)
	{
		$content = '';
		if (self::$open)
		{
			$content .= '</div></div>';
		}
		else
		{
			self::$open = true;
		}
		$content .= '<h3 class="pane-toggler title" id="' . $id . '"><a href="#' . $id . '"><span>' . $text . '</span></a></h3><div class="panel"><div class="pane-slider content">';

		return $content;
	}
963254
public function render(ElementInterface $element): string
    {
        $attributes = $element->attributes();

        return sprintf(
            '<progress %s>%s</progress>',
            $this->attributesToString($attributes),
            $this->escapeHtml($element->value())
        );
    }