Html: allow for string/int/float as tag content

This commit is contained in:
Thomas Gelf 2018-10-08 06:31:57 +02:00
parent ba47c39c51
commit 3632eea164
1 changed files with 5 additions and 1 deletions

View File

@ -27,7 +27,11 @@ abstract class Html
*/
public static function tag($name, $attributes = null, $content = null)
{
if ($attributes instanceof ValidHtml || is_string($attributes)) {
if ($attributes instanceof ValidHtml
|| is_string($attributes)
|| is_int($attributes)
|| is_float($attributes)
) {
$content = $attributes;
$attributes = null;
} elseif (is_array($attributes)) {