HTML attributes are incorrect

Issue #1 new
Tobias Köngeter created an issue

Problem

At the moment, HTML attributes are not working correctly. As described under https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes, negative boolean values can’t be written. So instead of writing attribute=”false” the attribute should disappear. The same goes for null, it should also disappear.

Example

<?php

echo new Video(
    '/my-video.mp4',
    [
        'autoplay' => true,
        'controls' => false,
    ]
);

The code above results in:

<video autoplay="autoplay" controls="false">
    <source src="/my-video.mp4" type="video/mp4">
</video>

But instead it should be:

<video autoplay="autoplay">
    <source src="/my-video.mp4" type="video/mp4">
</video>

Comments (1)

  1. Log in to comment