Parse the template file and return it as string

@param array $arrAttributes An optional attributes array

@return string The template markup
489739
public function parse($arrAttributes=null)
	{

		// Return a wildcard in the back end
		if (TL_MODE == 'BE')
		{
			/** @var \BackendTemplate|object $objTemplate */
			$objTemplate = new \BackendTemplate('be_wildcard');

			$objTemplate->wildcard = '### ' . $GLOBALS['TL_LANG']['FFL']['colStart'][0] . ' ###';

			return $objTemplate->parse();

		}

		return parent::parse($arrAttributes);
	}
817786
public static function buildAttributes($attribs)
    {
        $string = '';

        foreach ((array) $attribs as $key => $value) {
            if ($value === true) {
                $string .= ' ' . $key;

                continue;
            }

            if ($value === null || $value === false) {
                continue;
            }

            $string .= ' ' . $key . '=' . static::quote($value);
        }

        return $string;
    }
74720
public static function prepare_attr_value ($text) {
		if (is_array($text)) {
			/** @noinspection ForeachSourceInspection */
			foreach ($text as &$t) {
				$t = static::prepare_attr_value($t);
			}
			return $text;
		}
		return strtr(
			$text,
			[
				'&'  => '&amp;',
				'"'  => '&quot;',
				'\'' => '&apos;',
				'<'  => '&lt;',
				'>'  => '&gt;'
			]
		);
	}
454562
public function getHtml(array $attributes = []): string
    {
        return self::buildTag('input', null,
            array_merge(
                [
                    'type'     => $this->getType(),
                    'name'     => $this->getName(),
                    'value'    => $this->getText() !== '' ? $this->getText() : false,
                    'required' => $this->isRequired(),
                ],
                $attributes
            )
        );
    }
1202894
public function getAttributesHTML($attributes = null)
    {
        $exclude = null;

        if (is_string($attributes)) {
            $exclude = func_get_args();
        }

        if (!$attributes || is_string($attributes)) {
            $attributes = $this->getAttributes();
        }

        $attributes = (array) $attributes;

        $attributes = array_filter($attributes, function ($v) {
            return ($v || $v === 0 || $v === '0');
        });

        if ($exclude) {
            $attributes = array_diff_key(
                $attributes,
                array_flip($exclude)
            );
        }

        // Create markup
        $parts = array();

        foreach ($attributes as $name => $value) {
            if ($value === true) {
                $parts[] = sprintf('%s="%s"', $name, $name);
            } else {
                $strValue = Convert::raw2att($value);
                if (!is_string($strValue)) {
                    $strValue = json_encode($strValue);
                }
                $parts[] = sprintf('%s="%s"', $name, $strValue);
            }
        }

        return implode(' ', $parts);
    }
340643
public function parse()
    {
        $templates = array();
        $finder = new Finder(); 
        
        $directories = array(
            $this->templatesDir, 
        );
        
        $globalResourcesFolder = $this->kernelDir . '/Resources/views/' . $this->themeName;
        if (is_dir($globalResourcesFolder)) {
            $directories[] = $globalResourcesFolder;
        }
        
        $templateFiles = $finder->files('*.twig')->in($directories);
        foreach ($templateFiles as $template) {
            $template = (string)$template;
            $templateName = basename($template);
            $templateContents = file_get_contents($template);
            
            $slots = $this->fetchSlots($templateContents);
            if (empty($slots)) {
                continue;
            }
            
            $templates[$templateName]['assets']['external_stylesheets'] = $this->fetchExternalStylesheets($templateContents);
            $templates[$templateName]['assets']['external_javascripts'] = $this->fetchExternalJavascripts($templateContents);
            $templates[$templateName]['assets']['external_stylesheets_cms'] = $this->fetchExternalStylesheetsCms($templateContents);
            $templates[$templateName]['assets']['external_javascripts_cms'] = $this->fetchExternalJavascriptsCms($templateContents);
            $templates[$templateName]['slots'] = $slots;
            if (strpos($template, $this->kernelDir) === false) {
                $templates[$templateName]['generate_template'] = dirname($template) == $this->templatesDir;
            }
        }
        
        return $templates;
    }
771707
public function attributable(array $attributes, array $defaults = []): string
    {
        return $this->attributes($this->decorate($attributes, $defaults));
    }
48642
protected function _mergeAttributes($aAttributes, $aParentAttributes)
    {

        if (count($aParentAttributes)) {
            $aAttrIds = [];
            foreach ($aAttributes as $aAttribute) {
                $aAttrIds[] = $aAttribute['OXID'];
            }

            foreach ($aParentAttributes as $aAttribute) {
                if (!in_array($aAttribute['OXID'], $aAttrIds)) {
                    $aAttributes[] = $aAttribute;
                }
            }
        }

        return $aAttributes;
    }
889551
final public function parseAttributes() {
        $return = '';
        if (!$this->attributes)
            $this->attributes = new Object();
        foreach ($this->attributes->toArray() as $attr => $val) {
            $return .= \Util::camelToHyphen($attr) . '="' . $val . '" ';
        }
        return $return;
    }
1175432
protected function _renderHtmlAttribs(Garp_Util_Configuration $attribs) {
        $attributePairs = array();
        foreach ($attribs as $attribName => $attribValue) {
            $attributesPairs[] = $attribName . '="' . $attribValue . '"';
        }
        return implode(' ', $attributesPairs);
    }
1073927
public function parseAttributes($attributes)
    {
        if($attributes) {
            $htmlMeta = ' ';
            foreach ($attributes as $key => $value) {
                // false async means no async
                if ($key == 'async' && $value == false) {
                    continue;
                }
                //convert boolean to string
                if ($value === false) {
                    $value = 'false';
                } else if ($value === true) {
                    $value = 'true';
                }

                $htmlMeta .= $key . '="' . $value . '" ';
            }
            return $htmlMeta;

        }
        return;
    }
215764
public static function attributes(array $attributes): string
    {
        ksort($attributes);

        $html = '';
        foreach ($attributes as $attribute => $value) {
            $value = !is_scalar($value) ? json_encode($value) : (string)$value;

            $html .= sprintf('%s="%s" ', self::escape($attribute), self::escape($value));
        }

        return rtrim($html);
    }
693955
static function htmlAttributes(array $attributes = array()) {
    foreach ($attributes as $attribute => &$data) {
      $data = implode(' ', (array) $data);
      $data = $attribute . '="' . self::checkPlain($data) . '"';
    }
    return $attributes ? ' ' . implode(' ', $attributes) : '';
  }
172049
public function parse($arrAttributes = null)
    {
        // Messages (passed on to fineuploader JS)
        $basicTextOptions = array(
            'text'  => array(
                'formatProgress',
                'failUpload',
                'waitingForResponse',
                'paused',
            ),
            'messages'  => array(
                'typeError',
                'sizeError',
                'minSizeError',
                'emptyError',
                'noFilesError',
                'tooManyItemsError',
                'maxHeightImageError',
                'maxWidthImageError',
                'minHeightImageError',
                'minWidthImageError',
                'retryFailTooManyItems',
                'onLeave',
                'unsupportedBrowserIos8Safari',
            ),
            'retry' => array(
                'autoRetryNote',
            ),
            'deleteFile' => array(
                'confirmMessage',
                'deletingStatusText',
                'deletingFailedText',
            ),
            'paste' => array(
                'namePromptMessage',
            )
        );

        $config = array();

        foreach ($basicTextOptions as $category => $messages) {
            foreach ($messages as $message) {
                // Only translate if available, otherwise fall back to default (EN)
                if (isset($GLOBALS['TL_LANG']['MSC']['fineuploader_trans'][$category][$message])) {
                    $config[$category][$message] = $GLOBALS['TL_LANG']['MSC']['fineuploader_trans'][$category][$message];
                }
            }
        }

        // BC (used to be a JSON string)
        if (isset($this->arrConfiguration['uploaderConfig'])
            && $this->arrConfiguration['uploaderConfig'] !== ''
        ) {
            $this->arrConfiguration['uploaderConfig'] = json_decode('{' . $this->arrConfiguration['uploaderConfig'] . '}', true);
        }

        // Merge with custom options
        $this->config = json_encode(array_merge($config, (array) $this->arrConfiguration['uploaderConfig']));

        // Labels (in HTML)
        $labels = array(
            'drop',
            'upload',
            'processing',
            'cancel',
            'retry',
            'delete',
            'close',
            'yes',
            'no',
        );

        $preparedLabels = array();

        foreach ($labels as $label) {
            $preparedLabels[$label] = $GLOBALS['TL_LANG']['MSC']['fineuploader_' . $label];
        }

        // Set the upload button label
        if ($this->uploadButtonLabel) {
            $preparedLabels['upload'] = $this->uploadButtonLabel;
        }

        $this->labels = $preparedLabels;

        return parent::parse($arrAttributes);
    }
785284
public static function buildAttribString($attribs, $dblEnc = false)
    {
        if (!$dblEnc && \is_array($attribs)) {
            foreach ($attribs as $k => $v) {
                if (\is_string($v)) {
                    $attribs[$k] = \htmlspecialchars_decode($v);
                }
            }
        }
        return \bdk\Debug\Utilities::buildAttribString($attribs);
    }
644938
protected function renderAttribs()
    {
        $strHtml = '';
        foreach ($this->aAttribs as $strKey => $mValue) {
            $strHtml .= is_bool($mValue)
                ? ($mValue ? $strKey : '') // just the attribute name for booleans
                : $strKey . '="' . $mValue . '"'; // otherwise key="value"
        }
        return $strHtml;
    }
675236
function toString( $objectAttribute )
    {
        $mediaFile = $objectAttribute->content();

        if ( is_object( $mediaFile ) )
        {
            return implode( '|', array( $mediaFile->attribute( 'filepath' ), $mediaFile->attribute( 'original_filename' ) ) );
        }
        else
            return '';
    }