---
title: "Feature: #110769 - Allow boolean and arbitrary values in HTML attributes"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-110769-1790196401"
source: "Changelog/15.0/Feature-110769-AllowBooleanAndArbitraryValuesInHtmlAttributes.rst"
typo3-version: "15.0"
typo3-major: 15
type: "feature"
issue: 110769
forge: "https://forge.typo3.org/issues/110769"
tags: ["PHP-API", "Frontend", "ext:core"]
rendered: "2026-10-07T18:53:34+00:00"
---

# Feature: #110769 - Allow boolean and arbitrary values in HTML attributes {#feature-110769-1790196401}

See [forge#110769](https://forge.typo3.org/issues/110769)

## Description {#description}

`\TYPO3\CMS\Core\Utility\GeneralUtility::implodeAttributes()` now has an
optional fourth parameter `$convertValues`. When enabled, values are
converted for HTML5 output:

-   `true` renders an attribute without a value, for example
    `defer` instead of `defer="defer"`
-   `false` and `null` omit the attribute
-   objects implementing `\Stringable` are cast to string
-   other arrays and objects are JSON-encoded and escaped for the attribute
-   all other values are escaped with `htmlspecialchars()`

Example:

```php
GeneralUtility::implodeAttributes([
    'src' => '/file.js',
    'defer' => true,
    'nomodule' => false,
    'data-config' => ['a' => 1],
], true, false, true);
// src="/file.js" defer data-config="{&quot;a&quot;:1}"
```

The option is used when rendering script, link and style tags in
`\TYPO3\CMS\Core\Page\PageRenderer`,
`\TYPO3\CMS\Core\Page\AssetRenderer` and
`\TYPO3\CMS\Core\Page\JavaScriptRenderer`, as well as for the
`<meta>` tags of the meta tag managers, the `<html>` tag
configured via `config.htmlTag.attributes` and the
`<video>` and `<audio>` tags.

## Impact {#impact}

Extension authors can pass boolean values and arrays as tag attributes, for
example via `tagAttributes` of the `\TYPO3\CMS\Core\Page\PageRenderer` or the
`additionalAttributes` option of the video and audio renderers.

The default behavior of `implodeAttributes()` is unchanged.

In the video and audio renderers, `true` in `additionalAttributes`
now renders an attribute without a value (`playsinline`) instead of
`playsinline="1"`, and `false` removes the attribute, including
default ones such as `controls`.

Enumerated attributes such as `aria-hidden` or `draggable` must
still be passed as the strings `'true'` or `'false'`, since
omitting them is not the same as setting them to "false". Attributes without a
value are not XML-compliant.
