Convert dynamicRemoveLabelMeta array to html attributes+values
@return string
171952
protected function __getDynamicRemoveLabelMetaString()
    {
        $strOutput = "";

        if (is_array($this->__dynamicremovelabelmeta)) {
            foreach ($this->__dynamicremovelabelmeta as $key => $value) {
                if (! in_array($key, $this->__reservedmeta)) {
                    $strOutput .= " {$key}=\"{$value}\"";
                }
            }
        }

        return $strOutput;
    }
781762
public function getHtml(): string
  {
    $this->attributes['type'] = $this->buttonType;
    $this->attributes['name'] = $this->submitName;

    if ($this->formatter) $this->attributes['value'] = $this->formatter->format($this->value);
    else                  $this->attributes['value'] = $this->value;

    $ret = $this->prefix;
    $ret .= $this->getHtmlPrefixLabel();
    $ret .= Html::generateVoidElement('input', $this->attributes);
    $ret .= $this->getHtmlPostfixLabel();
    $ret .= $this->postfix;

    return $ret;
  }
1112116
public function getAttributeValueTextRepresentation()
    {
        $value = $this->getAttributeValueObject();

        return [
            $value ? (string) $value->getAddress1() : '',
            $value ? (string) $value->getAddress2() : '',
            $value ? (string) $value->getAddress3() : '',
            $value ? (string) $value->getCity() : '',
            $value ? (string) $value->getStateProvince() : '',
            $value ? (string) $value->getCountry() : '',
            $value ? (string) $value->getPostalCode() : '',
        ];
    }
1077948
function toHtml(){
        $retval = '';
        if ($this->_hiddenLabel){
            $this->_generateId();
            $retval = '<label class="accesshide" for="'.$this->getAttribute('id').'" >'.
                        $this->getLabel().'</label>'.parent::toHtml();
        } else {
             $retval = parent::toHtml();
        }

        if (!empty($this->_link)) {
            if (!empty($this->_linkreturn) && is_array($this->_linkreturn)) {
                $appendchar = '?';
                if (strstr($this->_link, '?')) {
                    $appendchar = '&amp;';
                }

                foreach ($this->_linkreturn as $key => $val) {
                    $this->_link .= $appendchar."$key=$val";
                    $appendchar = '&amp;';
                }
            }

            $retval .= '<a style="margin-left: 5px" href="'.$this->_link.'">'.$this->_linklabel.'</a>';
        }

        return $retval;
    }
546377
public function toString(): string
    {
        $message = "the element [{$this->selector}]";

        if (! empty($this->attributes)) {
            $message .= ' with the attributes '.json_encode($this->attributes);
        }

        return $message;
    }
544066
public function getMetaImageLinkAttributes()
    {
        $attributes = [
            'href' => $this->owner->MetaImageLink,
            'class' => $this->owner->MetaImageLinkClass,
            'title' => $this->owner->MetaTitle
        ];
        
        if ($extra = Config::inst()->get(self::class, 'image_link_attributes')) {
            
            foreach ($extra as $name => $value) {
                
                // Process Attribute Value:
                
                $attributes[$name] = ViewTools::singleton()->processAttribute(
                    $value,
                    $this->owner,
                    $this->owner->Renderer
                );
                
            }
            
        }
        
        return $attributes;
    }
895915
public function __toAttribute()
	{
		if ( $this->count() ) {
			$attr = null;

			if ( is_string( $this->attribute ) ) {
				$attr = $this->attribute;
			}
			elseif ( $this->attribute instanceof DOMAttr ) {
				$attr = $this->attribute->name;
			}

			if ( $attr ) {
				$values = htmlspecialchars((string) $this, ENT_QUOTES, ini_get('default_charset'), false);
				return sprintf('%1$s="%2$s"', $attr, $values);
			}
		}

		return '';
	}
751464
public function getAttributeValueTextRepresentation()
    {
        $links = [];
        $value = $this->getAttributeValueObject();
        if ($value !== null) {
            foreach ($value->getSelectedLinks() as $socialLink) {
                $links[] = $socialLink->getService() . ':' . $socialLink->getServiceInfo();
            }
        }

        return implode("\n", $links);
    }
1142380
public function getActionLabelAttribute()
    {
        $map = [
            'created' => 'success',
            'updated' => 'warning',
            'deleted' => 'danger',
            'published' => 'info',
            'unpublished' => 'default',
        ];

        return sprintf('<a href="%s" class="label label-%s">%s</a>',
            $this->filterUrl(['action' => $this->action]),
            isset($map[$this->action]) ? $map[$this->action] : 'info',
            __("decoy::changes.actions.$this->action"));
    }
1079004
public function getGroupedHtml()
    {
        $name = $this->getNameInLayout();
        $htmlId = uniqid($name);

        $types = [];
        foreach ($this->_usedStorageTypes as $type) {
            $type = $this->getVarnishMessageModel()->getMessageTypeByStorage($type);
            if (!$type) {
                continue;
            }
            $types[] = $type;
        }

        return sprintf(
            $this->getMessageContainerFormat(),
            json_encode($htmlId),
            json_encode($this->getUrl('varnish/ajax/message', array(
                '_secure' => Mage::app()->getStore()->isCurrentlySecure()
            ))),
            json_encode($types),
            json_encode(EcomDev_Varnish_Model_Message::COOKIE_NAME),
            json_encode(array(
                'path' => Mage::getSingleton('core/cookie')->getPath(),
                'domain' => Mage::getSingleton('core/cookie')->getDomain()
            ))
        );
    }
885668
public function getLabelAttributes()
    {
        $result = [];
        $label = $this->element->getLabel();
        foreach ($label->getAttributes() as $attribute => $value) {
            if (null === $value) {
                $result[] = $attribute;
                continue;
            }

            $result[] = "{$attribute}=\"{$value}\"";
        }
        return implode(' ', $result);
    }
952631
public function getModelNameHtmlAttribute()
    {
        $class = Decoy::controllerForModel($this->model);

        // There is not a controller for the model
        if (!$class || !class_exists($class)) {
            return sprintf('<b><a href="%s">%s</a></b>',
            $this->filterUrl(['model' => $this->model]),
            preg_replace('#(?<!\ )[A-Z]#', ' $0', $this->model));
        }

        // There is a corresponding controller class
        $controller = new $class;
        return sprintf('<b class="js-tooltip" title="%s"><a href="%s">%s</a></b>',
            htmlentities($controller->description()),
            $this->filterUrl(['model' => $this->model]),
            Str::singular($controller->title()));
    }
595588
public function getAttributeValueTextRepresentation()
    {
        $value = $this->getAttributeValueObject();
        if ($value === null) {
            $result = '';
        } else {
            $options = [];
            foreach ($value->getSelectedOptions() as $selectedOption) {
                /* @var SelectValueOption $selectedOption */
                $options[] = $selectedOption->getSelectAttributeOptionValue();
            }
            $result = implode("\n", $options);
        }

        return $result;
    }
817009
protected function getColname()
    {
        if ($this->getParamName() && ('single' === $this->get('datamode'))) {
            return $this->getMetaModel()->getAttribute($this->get('single_attr_id'))->getColname();
        }

        if ($this->getParamName() && ('multi' === $this->get('datamode'))) {
            return $this->getMetaModel()->getAttribute($this->get('first_attr_id'))->getColname();
        }

        return null;
    }
4144
public function toString() {
		// List of void elements from HTML5, section 8.1.2 as of 2016-09-19
		static $voidElements = [
			'area',
			'base',
			'br',
			'col',
			'embed',
			'hr',
			'img',
			'input',
			'keygen',
			'link',
			'meta',
			'param',
			'source',
			'track',
			'wbr',
		];

		$attributes = '';
		foreach ( $this->getGeneratedAttributes() as $key => $value ) {
			if ( !preg_match( '/^[0-9a-zA-Z-]+$/', $key ) ) {
				throw new Exception( 'Attribute name must consist of only ASCII letters, numbers and dash' );
			}

			// Note that this is not a complete list of HTML attributes that need this validation.
			// We only check for the ones that are generated by built-in OOUI PHP elements.
			if ( $key === 'href' || $key === 'action' ) {
				if ( !self::isSafeUrl( $value ) ) {
					// We can't tell for sure whether this URL is safe (although it might be). The only safe
					// URLs that we can't check for is relative ones, so just prefix with './'. This should
					// change nothing for relative URLs, and it will neutralize sneaky 'javascript:' URLs.
					$value = './' . $value;
				}
			}

			// Use single-quotes around the attribute value in HTML, because
			// some of the values might be JSON strings
			// 1. Encode both single and double quotes (and other special chars)
			$value = htmlspecialchars( $value, ENT_QUOTES );
			// 2. Decode double quotes, for readability.
			$value = str_replace( '&quot;', '"', $value );
			// 3. Wrap attribute value in single quotes in the HTML.
			$attributes .= ' ' . $key . "='" . $value . "'";
		}

		// Content
		$content = '';
		foreach ( $this->content as $part ) {
			if ( is_string( $part ) ) {
				$content .= htmlspecialchars( $part );
			} elseif ( $part instanceof Tag || $part instanceof HtmlSnippet ) {
				$content .= (string)$part;
			}
		}

		if ( !preg_match( '/^[0-9a-zA-Z]+$/', $this->tag ) ) {
			throw new Exception( 'Tag name must consist of only ASCII letters and numbers' );
		}

		// Tag
		if ( !$content && in_array( $this->tag, $voidElements ) ) {
			return '<' . $this->tag . $attributes . ' />';
		} else {
			return '<' . $this->tag . $attributes . '>' . $content . '</' . $this->tag . '>';
		}
	}
932031
public function renderAttributes() : string
    {
        $pairs = array_map(function(string $value, string $key) {
            return sprintf('%s="%s"', helpers\e($key), helpers\e($value));
        }, $this->attributes, array_keys($this->attributes));

        return implode(' ', $pairs);
    }
740256
function toHtml()
    {
        $tabs    = $this->_getTabs();
        $name    = $this->getPrivateName();
        $strHtml = '';

        foreach ($this->_values as $key => $val) {
            for ($i = 0, $optCount = count($this->_options); $i < $optCount; $i++) {
                if ($val == $this->_options[$i]['attr']['value']) {
                    $strHtml .= $tabs . '<input' . $this->_getAttrString(array(
                        'type'  => 'hidden',
                        'name'  => $name,
                        'value' => $val
                    )) . " />\n" ;
                }
            }
        }

        return $strHtml;
    }