Html: allow for string/int/float as tag content
This commit is contained in:
parent
ba47c39c51
commit
3632eea164
|
@ -27,7 +27,11 @@ abstract class Html
|
||||||
*/
|
*/
|
||||||
public static function tag($name, $attributes = null, $content = null)
|
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;
|
$content = $attributes;
|
||||||
$attributes = null;
|
$attributes = null;
|
||||||
} elseif (is_array($attributes)) {
|
} elseif (is_array($attributes)) {
|
||||||
|
|
Loading…
Reference in New Issue