@param ElementInterface $element

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

        return sprintf(
            '<progress %s>%s</progress>',
            $this->attributesToString($attributes),
            $this->escapeHtml($element->value())
        );
    }
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;
    }
589515
public function convert(ElementInterface $element)
    {
        $children = array();

        foreach ($element->getChildren() as $item)
        {
            $value = str_replace("\n", ' ', $item->getValue());

            $null = $value === ' ' || empty($value);

            $null === false && array_push($children, $value);
        }

        return implode(' - ', $children) . "\n";
    }
844821
protected function getMethodNameForClass(Element $element)
    {
        // if a method exists for this element, then use that one
        $className = get_class($element);

        // strip namespaces;
        $className = substr($className, strrpos($className, '\\') + 1);

        // make first char lower case
        return strtolower(substr($className, 0, 1)) . substr($className, 1);
    }
831572
public function processElement(\DOMElement $element, ContextInterface $context)
    {
        // Create a property
        $propertyContext = $this->processProperty($element, $context);

        // Process the element in case it's an anonymous thing with no children
        if (!$element->childNodes->length) {
            $this->processChild($element, $context);
        }

        return $propertyContext;
    }
753597
public function getInputHtml($value, ElementInterface $element = null): string
    {
        // Get our id and namespace
        $id = Craft::$app->getView()->formatInputId($this->handle);
        $namespacedId = Craft::$app->getView()->namespaceInputId($id);

        // Render the input template
        return Craft::$app->getView()->renderTemplate(
            'preparse-field/_components/fields/_input',
            [
                'name' => $this->handle,
                'value' => $value,
                'field' => $this,
                'id' => $id,
                'namespacedId' => $namespacedId,
            ]
        );
    }
55574
public function convert(ElementInterface $element)
    {
        $lines = explode("\n", $element->getValue());

        foreach ($lines as $key => $line)
        {
            $lines[$key] = trim($lines[$key]);
        }

        $lines = array_filter($lines);

        return "\n" . implode("\n", (array) $lines);
    }
356274
public function add(ElementInterface $element)
    {
        if (null === $element->getName()) {
            $this->data[] = $element;
            return $this;
        }
        $this->data[$element->getName()] = $element;
        return $this;
    }
102834
private function elementBodyClasses(string $element) : string
    {
        if (in_array($element, $this->body_elements) === true) {
            $class = '';

            if (count($this->body_classes[$element]) > 0) {
                if (array_key_exists($element, $this->body_classes_first) === false) {
                    $class = ' ' . implode(' ', $this->body_classes[$element]);
                } else {
                    $class = '';
                    foreach ($this->body_classes[$element] as $body_class) {
                        if (array_key_exists($body_class, $this->body_classes_first[$element]) === false) {
                            $class .= ' ' . $body_class;
                        } else {
                            if ($this->body_classes_first[$element][$body_class] === true) {
                                $class .= ' ' . $body_class;
                                $this->body_classes_first[$element][$body_class] = false;
                            }
                        }
                    }
                }
            }

            return $class;
        } else {
            return '';
        }
    }
349435
public function render(ElementInterface $element)
    {
        $captcha = $element->getCaptcha();

        if ($captcha === null || !$captcha instanceof CaptchaAdapter) {
            throw new Exception\DomainException(sprintf(
                '%s requires that the element has a "captcha" attribute of type Zend\Captcha\Image; none found',
                __METHOD__
            ));
        }

        $captcha->generate();

        $imgAttributes = array(
            'width'  => $captcha->getWidth(),
            'height' => $captcha->getHeight(),
            'alt'    => $captcha->getImgAlt(),
            'src'    => $captcha->getImgUrl() . $captcha->getId() . $captcha->getSuffix(),
        );

        if ($element->hasAttribute('id')) {
            $imgAttributes['id'] = $element->getAttribute('id') . '-image';
        }

        $closingBracket = $this->getInlineClosingBracket();
        $img = sprintf(
            '<img %s%s',
            $this->createAttributesString($imgAttributes),
            $closingBracket
        );

        $position     = $this->getCaptchaPosition();
        $separator    = $this->getSeparator();
        $captchaInput = $this->renderCaptchaInputs($element);

        $pattern = '<div style="float:left;" class="form-captcha-image">%s%s</div><div class="form-captcha-input" style="margin-left:' . $imgAttributes['width'] . 'px">%s</div>';
        if ($position == self::CAPTCHA_PREPEND) {
            return sprintf($pattern, $captchaInput, $separator, $img);
        }
        return sprintf($pattern, $img, $separator, $captchaInput);
    }
1049204
public function afterElementRestore (ElementInterface $element)
	{
		SimpleMap::getInstance()->map->restoreField($this, $element);
		parent::afterElementRestore($element);
	}
673766
public function validateBlocks(ElementInterface $element)
    {
        /** @var Element $element */
        /** @var SuperTableBlockQuery $value */
        $value = $element->getFieldValue($this->handle);

        foreach ($value->all() as $i => $block) {
            /** @var SuperTableBlock $block */
            if ($element->getScenario() === Element::SCENARIO_LIVE) {
                $block->setScenario(Element::SCENARIO_LIVE);
            }

            if (!$block->validate()) {
                foreach ($block->getErrors() as $attribute => $errors) {
                    $element->addErrors([
                        "{$this->handle}[{$i}].{$attribute}" => $errors,
                    ]);
                }
            }
        }
    }
1144127
public static function fieldsOfType(ElementInterface $element, string $fieldType): array
    {
        $foundFields = [];

        $layout = $element->getFieldLayout();
        if ($layout === null) {
            return [];
        }
        $fields = $layout->getFields();
        /** @var  $field BaseField */
        foreach ($fields as $field) {
            if ($field instanceof $fieldType) {
                $foundFields[] = $field->handle;
            }
        }

        return $foundFields;
    }
97971
public function render(ElementInterface $element): string
    {
        if (! $element instanceof ErrorAwareInterface) {
            throw new InvalidClassException(
                sprintf(
                    'The given element "%s" does not implement "%s"',
                    $element->name(),
                    ErrorAwareInterface::class
                )
            );
        }

        $errors = $element->errors();
        if (count($errors) < 1) {
            return '';
        }

        $html = array_reduce(
            $errors,
            function ($html, $error): string {
                $html .= sprintf(
                    $this->options['error'],
                    $error
                );

                return $html;
            },
            ''
        );

        return sprintf(
            $this->options['wrapper'],
            $html
        );
    }
165412
public function withElement(ElementInterface ...$elements): CollectionElement
    {
        array_walk(
            $elements,
            function (ElementInterface $element) {
                $this->elements[$element->name()] = $element;
            }
        );

        return $this;
    }
368267
private function renderElement(Element $element) : string
    {
        $label = $element->getLabel();

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

        return $label->render() . $element->render();
    }
1239958
public function processElement(\DOMElement $element, ContextInterface $context)
    {
        // Process default vocabulary registrations
        $context = $this->processVocab($element, $context);

        // Register vocabulary prefixes
        $context = $this->processPrefix($element, $context);

        // Create a property
        return $this->processProperty($element, $context);
    }