From 1add9b421ac013612595cf18581d7fd15e7c159f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Thu, 28 Apr 2016 14:06:22 +0200 Subject: [PATCH] Treat boolean attributes as HTML properties --- src/HtmlBuilder.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/HtmlBuilder.php b/src/HtmlBuilder.php index 7306fc4..1d40f68 100755 --- a/src/HtmlBuilder.php +++ b/src/HtmlBuilder.php @@ -447,6 +447,11 @@ class HtmlBuilder if (is_numeric($key)) { $key = $value; } + + // Treat boolean attributes as HTML properties + if (is_bool($value)) { + return $value ? $key : ''; + } if (! is_null($value)) { return $key . '="' . e($value) . '"';