Render errors.

@param ElementInterface $element

@return null|\SxBootstrap\View\Helper\Bootstrap\Form\Errors
509959
protected function renderError(ElementInterface $element)
    {
        $messages = $element->getMessages();

        if (empty($messages)) {
            return null;
        }

        $errorPlugin = $this->getView()->plugin('sxb_form_errors');

        return $errorPlugin($element);
    }
119846
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        if ($this->getValues()) {
            $element->setValue($this->getValues());
        }

        $this->setElement($element);

        return $this->toHtml();
    }
853891
public function render(ElementInterface $element): string
    {
        if (! $element instanceof ChoiceElementInterface) {
            throw new InvalidClassException(
                sprintf(
                    'The given element "%s" has to implement "%s"',
                    $element->name(),
                    ChoiceElementInterface::class
                )
            );
        }

        $attributes = $element->attributes();
        unset($attributes['type'], $attributes['value']);

        return sprintf(
            '<select %s>%s</select>',
            $this->attributesToString($attributes),
            $this->renderChoices($element->choices(), $element->value())
        );
    }
175745
public function getValidationMessageFor($element)
    {
        $errorLabel = $this->getElement($element)->getParent()->find('css', '.sylius-validation-error');

        if (null === $errorLabel) {
            throw new ElementNotFoundException(
                $this->getSession(),
                'Validation message', 'css', '.sylius-validation-error')
            ;
        }

        return $errorLabel->getText();
    }
1215805
public function renderRow(ElementInterface $element)
    {
        /* @var $rowPlugin \SxBootstrap\View\Helper\Bootstrap\Form\ControlGroup */
        $rowPlugin   = $this->getView()->plugin('sxb_form_control_group');
        $rowPlugin   = $rowPlugin();
        $errors      = $this->renderError($element);
        $label       = $this->renderLabel($element);
        $description = $this->renderDescription($element);
        $controls    = $this->renderControls($element, null !== $errors ? $errors : $description);

        if (null !== $errors) {
            $rowPlugin->error();
        }

        $rowPlugin->addContents(array(
            $label,
            $controls,
        ));

        return $rowPlugin;
    }
957454
public function validate(ErrorElement $errorElement, BlockInterface $block)
    {
        if (!$block->getId() && !$block->getType()) {
            return;
        }

        if ($this->inValidate) {
            return;
        }

        // As block can be nested, we only need to validate the main block, no the children
        try {
            $this->inValidate = true;
            $this->get($block)->validateBlock($errorElement, $block);
            $this->inValidate = false;
        } catch (\Exception $e) {
            $this->inValidate = false;
        }
    }
356274
public function add(ElementInterface $element)
    {
        if (null === $element->getName()) {
            $this->data[] = $element;
            return $this;
        }
        $this->data[$element->getName()] = $element;
        return $this;
    }
854651
protected function renderType(ElementInterface $element)
    {
        $value = $this->getElementValue($element);
        $type  = gettype($value);

        if (isset($this->typeMap[$type])) {
            return $this->renderHelper($this->typeMap[$type], $value, $element);
        }

        return;
    }
61434
public function validationErrors(FormRuntime $formRuntime, RootRenderableInterface $element): array
    {
        return $this->getValidationResult($formRuntime, $element)->getErrors();
    }
1015298
protected function createErrorMessage(\marvin255\serviform\interfaces\Field $element)
    {
        $value = $element->getValue();
        $replaces = [
            '#label#' => $element->getLabel(),
            '#value#' => is_array($value) ? '' : $value,
            '#name#' => $element->getName(),
        ];

        return str_replace(
            array_keys($replaces),
            array_values($replaces),
            $this->message
        );
    }
1140831
protected function renderType(ElementInterface $element)
    {
        $type = $element->getAttribute('type');

        if (isset($this->typeMap[$type])) {
            return $this->renderHelper($this->typeMap[$type], $element);
        }
        return null;
    }
643219
public function validateSections(ElementInterface $element)
	{
		$value = $element->getFieldValue($this->handle);

		if (!is_array($value)) {
			$value = [$value];
		}

		$sections = $this->getSections();

		foreach ($value as $section) {
			if (!isset($sections[$section])) {
				$element->addError($this->handle, Craft::t('section-field', 'Invalid section selected.'));
			}
		}
	}
398792
public function validate($element) {
        $this->last_error = null;
        $celement   = realpath($element);
        $cvalidator = realpath($this->location.DIRECTORY_SEPARATOR.$this->type);
        $result = (empty($celement) || empty($cvalidator));
        if (!$result) {
            $xml_error = new libxml_errors_mgr();
            $doc = new DOMDocument();
            $doc->validateOnParse = false;
            $result = $doc->load($celement, LIBXML_NONET) &&
                      $doc->schemaValidate($cvalidator);
        }
        return $result;
    }
211153
public function render(Element $element)
    {
        $method = $this->getMethodNameForClass($element);

        if (!method_exists($this, $method)) {
            throw new \Exception('Error, render method "' . $method . '" was not found');
        }

        $errorHtml = $this->renderErrorMessages($element);

        $helpHtml = $this->renderHelpText($element);

        $html = $this->$method($element);

        return $html . $helpHtml . $errorHtml;
    }
1311290
public function convert(ElementInterface $element)
    {
        $tag = $element->getTagName();

        $value = $element->getValue();

        if ($tag === 'i' || $tag === 'em')
        {
            $style = $this->config->getOption('italic_style');
        }
        else
        {
            $style = $this->config->getOption('bold_style');

            if (! $this->hasLinks($value))
            {
                $value = mb_convert_case($value, MB_CASE_UPPER, 'UTF-8');
            }
        }

        list($prefix, $suffix) = $this->prefixSuffix($value);

        return $prefix . $style . trim($value) . $style . $suffix;
    }
177236
protected function getFormErrors(FormInterface $form)
    {
        $errors = [];
        foreach ($form->getErrors() as $error) {
            $errors[] = $error->getMessage();
        }
        foreach ($form->all() as $child) {
            if (!$child->isValid()) {
                $errors[$child->getName()] = $this->getFormErrors($child);
            }
        }

        return $errors;
    }
39499
protected function renderElement(ElementInterface $element)
    {
        $collection = $this->getAttributesCollection($element);

        $this->addElementChildren($element, $collection);
        $this->addElementDependencies($element, $collection);
        $this->addElementRules($element, $collection);

        return $this->formatter->formatAttributesCollection($collection);
    }