Render control

@param  ElementInterface $element
@param  string           $elementString
@param  string           $id
@param  string           $controlWrapper
@return string
175589
protected function renderControl(ElementInterface $element, $elementString, $id, $controlWrapper = null)
    {
        $description = $this->getDescriptionHelper()->render($element);
        $label       = $this->renderLabel($element);
        $control     = $this->renderControlWrapper($id, $element, $elementString, $description, $controlWrapper);
        if ($label) {
            switch ($this->labelPosition) {
                case self::LABEL_PREPEND:
                    return $label . $control;
                case self::LABEL_APPEND:
                default:
                    return $control . $label;
            }
        }
        return $control;
    }
423382
public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = false, $mode = null, $entry_id = null)
    {
        $value = ($data['value'] === 'yes' ? 'Yes' : 'No');

        $wrapper->appendChild(new XMLElement($this->get('element_name'), ($encode ? General::sanitize($value) : $value)));
    }
222425
private void paintAjax(final WRadioButtonSelect rbSelect, final XmlStringBuilder xml) {
		// Start tag
		xml.appendTagOpen("ui:ajaxtrigger");
		xml.appendAttribute("triggerId", rbSelect.getId());
		xml.appendClose();

		// Target
		xml.appendTagOpen("ui:ajaxtargetid");
		xml.appendAttribute("targetId", rbSelect.getAjaxTarget().getId());
		xml.appendEnd();

		// End tag
		xml.appendEndTag("ui:ajaxtrigger");
	}
869791
protected function renderControlWrapper ($renderedCode) {
		$wrapperReplacement = '{control}';
		$wrapper = mb_strpos($wrapperReplacement, $this->wrapper) !== FALSE 
			? $this->wrapper 
			: $wrapperReplacement;
		return str_replace($wrapperReplacement, $renderedCode, $wrapper);
	}
774964
function renderToString(element) {
  !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : _prodInvariant('46') : void 0;
  return renderToStringImpl(element, false);
}
308658
protected function renderHelper($name, ElementInterface $element)
    {
        $helper = $this->getView()->plugin($name);
        return $helper($element);
    }
377553
protected function renderPanelElement($element, $cssClass)
    {
        $environment = $this->getEnvironment();

        $event = new GetPanelElementTemplateEvent($environment, $element);
        $environment->getEventDispatcher()->dispatch($event::NAME, $event);

        $template = $event->getTemplate();

        if (null === $template) {
            return '';
        }

        $template->set('rowClass', $cssClass);
        $element->render($template);

        return $template->parse();
    }
1186865
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WAjaxControl ajaxControl = (WAjaxControl) component;
		XmlStringBuilder xml = renderContext.getWriter();
		WComponent trigger = ajaxControl.getTrigger() == null ? ajaxControl : ajaxControl.
				getTrigger();
		int delay = ajaxControl.getDelay();

		if (ajaxControl.getTargets() == null || ajaxControl.getTargets().isEmpty()) {
			return;
		}

		// Start tag
		xml.appendTagOpen("ui:ajaxtrigger");
		xml.appendAttribute("triggerId", trigger.getId());
		xml.appendOptionalAttribute("loadOnce", ajaxControl.isLoadOnce(), "true");
		xml.appendOptionalAttribute("delay", delay > 0, delay);
		xml.appendClose();

		// Targets
		for (AjaxTarget target : ajaxControl.getTargets()) {
			xml.appendTagOpen("ui:ajaxtargetid");
			xml.appendAttribute("targetId", target.getId());
			xml.appendEnd();
		}

		// End tag
		xml.appendEndTag("ui:ajaxtrigger");
	}
1025311
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WRepeater repeater = (WRepeater) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:panel");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendClose();

		xml.appendTag("ui:content");
		paintRows(repeater, renderContext);
		xml.appendEndTag("ui:content");

		xml.appendEndTag("ui:panel");
	}
625102
public function render(
        $content,
        array $attribs = [],
        ElementInterface $element = null
    ) {
        if ($content instanceof LabelAwareInterface) {
            $content = $content->getLabel();
        } elseif ($element instanceof LabelAwareInterface) {
            $content = $element->getLabel();
        }

        if (is_string($content) && $this->hasTranslator() && $this->isTranslatorEnabled()) {
            $content = $this->getTranslator()->translate($content, $this->getTranslatorTextDomain());
        }

        if ($element instanceof FormInterface &&
            ($object = $element->getObject()) &&
            method_exists($object, '__toString')
        ) {
            $content = sprintf($content, $object);
        }

        if ($element
            && (!$element instanceof LabelAwareInterface ||
                !$element->getLabelOption('disable_html_escape'))
        ) {
            $escapeHtmlHelper = $this->getEscapeHtmlHelper();
            $content = $escapeHtmlHelper($content);
        }

        return parent::render($content, $attribs);
    }
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);
}
951216
public function renderGroup(
        ElementInterface $element,
        $elementString,
        $groupWrapper = null,
        $controlWrapper = null
    ) {
    
        $id      = $element->getAttribute('id') ? : $element->getAttribute('name');
        $control = $this->renderControl($element, $elementString, $id, $controlWrapper);
        return $this->renderGroupWrapper($element, $id, $control, $groupWrapper);
    }
99194
public static function coreHTMLElement($element, $content, array $attrs = []) {

        $template = "<%element%%attributes%>%innerHTML%</%element%>";

        $attributes = trim(StringHelper::parseArray($attrs));
        if (0 < strlen($attributes)) {
            $attributes = " " . $attributes;
        }

        $innerHTML = null !== $content ? trim($content, " ") : "";

        return StringHelper::replace($template, ["%element%", "%attributes%", "%innerHTML%"], [trim($element), $attributes, $innerHTML]);
    }
153228
protected function getElementLine($config, $manialink, $element, $width, $manialinkFactory)
    {
        $label = $this->uiFactory
            ->createLabel($this->getElementName($element))
            ->setX(2)
            ->setWidth($width * 0.66);
        $delButton = $this->uiFactory
            ->createButton('Remove')
            ->setWidth($width * 0.33)
            ->setAction(
                $this->actionFactory->createManialinkAction(
                    $manialink,
                    function (ManialinkInterface $manialink, $login, $entries, $args) use ($manialinkFactory) {
                        /** @var TextListConfig $config */
                        $config = $args['config'];
                        $config->remove($args['element']);

                        $manialinkFactory->update($manialink->getUserGroup());
                    },
                    ['config' => $config, 'element' => $element]
                )
            );

        return $this->uiFactory->createLayoutLine(0,0, [$label, $delButton]);
    }
1024181
public function renderForm($element = 'form', $params = [])
    {
        $this->controller->requireAsset('javascript', 'backstretch');

        $form_element = $this->mapAuthenticationTypeFilePath($element . '.php');
        if (!$form_element->exists()) {
            $form_element = $this->mapAuthenticationTypeFilePath('form.php');
            if (method_exists($this->controller, 'form')) {
                call_user_func_array([$this->controller, 'form'], $params);
            }
        }
        ob_start();
        if (method_exists($this->controller, $element)) {
            call_user_func_array([$this->controller, $element], $params);
        } else {
            $this->controller->view();
        }
        extract(array_merge($params, $this->controller->getSets()));
        require $form_element->file;
        $out = ob_get_contents();
        ob_end_clean();
        echo $out;
    }
1260779
public function render( ElementInterface $element )
    {
        if ( ! $element instanceof ColumnsPercentages )
        {
            throw new Exception\InvalidArgumentException( sprintf(
                '%s requires that the element is of type Grid\Paragraph\Form\Element\ColumnsPercentages',
                __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__
            ) );
        }

        $values = $element->getValue();
        if ( empty( $values ) )
        {
            $values = array();
        }

        $attributes = $element->getAttributes();
        $addAttr    = array(
            'type'      => 'number',
            'required'  => empty( $attributes['required'] ) ? null : 'required',
            'disabled'  => empty( $attributes['disabled'] ) ? null : 'disabled',
        );

        unset( $attributes['type'] );
        unset( $attributes['required'] );
        unset( $attributes['disabled'] );

        return sprintf(
            '<div %s>%s</div>',
            $this->createAttributesString( $attributes ),
            $this->renderPercentages( $values, $name, $addAttr )
        );
    }
419797
function renderElement(&$element, $required, $error){
        global $OUTPUT;

        // Make sure the element has an id.
        $element->_generateId();
        $advanced = isset($this->_advancedElements[$element->getName()]);

        $html = $OUTPUT->mform_element($element, $required, $advanced, $error, false);
        $fromtemplate = !empty($html);
        if (!$fromtemplate) {
            // Adding stuff to place holders in template
            // check if this is a group element first.
            if (($this->_inGroup) and !empty($this->_groupElementTemplate)) {
                // So it gets substitutions for *each* element.
                $html = $this->_groupElementTemplate;
            } else if (method_exists($element, 'getElementTemplateType')) {
                $html = $this->_elementTemplates[$element->getElementTemplateType()];
            } else {
                $html = $this->_elementTemplates['default'];
            }
            if (isset($this->_advancedElements[$element->getName()])) {
                $html = str_replace(' {advanced}', ' advanced', $html);
                $html = str_replace(' {aria-live}', ' aria-live="polite"', $html);
            } else {
                $html = str_replace(' {advanced}', '', $html);
                $html = str_replace(' {aria-live}', '', $html);
            }
            if (isset($this->_advancedElements[$element->getName()]) || $element->getName() == 'mform_showadvanced') {
                $html = str_replace('{advancedimg}', $this->_advancedHTML, $html);
            } else {
                $html = str_replace('{advancedimg}', '', $html);
            }
            $html = str_replace('{id}', 'fitem_' . $element->getAttribute('id'), $html);
            $html = str_replace('{typeclass}', 'f' . $element->getType(), $html);
            $html = str_replace('{type}', $element->getType(), $html);
            $html = str_replace('{name}', $element->getName(), $html);
            $html = str_replace('{groupname}', '', $html);
            $html = str_replace('{class}', $element->getAttribute('class'), $html);
            $emptylabel = '';
            if ($element->getLabel() == '') {
                $emptylabel = 'femptylabel';
            }
            $html = str_replace('{emptylabel}', $emptylabel, $html);
            if (method_exists($element, 'getHelpButton')) {
                $html = str_replace('{help}', $element->getHelpButton(), $html);
            } else {
                $html = str_replace('{help}', '', $html);
            }
        } else {
            if ($this->_inGroup) {
                $this->_groupElementTemplate = $html;
            }
        }
        if (($this->_inGroup) and !empty($this->_groupElementTemplate)) {
            $this->_groupElementTemplate = $html;
        } else if (!isset($this->_templates[$element->getName()])) {
            $this->_templates[$element->getName()] = $html;
        }

        if (!$fromtemplate) {
            parent::renderElement($element, $required, $error);
        } else {
            if (in_array($element->getName(), $this->_stopFieldsetElements) && $this->_fieldsetsOpen > 0) {
                $this->_html .= $this->_closeFieldsetTemplate;
                $this->_fieldsetsOpen--;
            }
            $this->_html .= $html;
        }
    }