final class HtmlHelpers

internal  
 

Runtime utilities for handling HTML.

Methods

static bool
isVoidElement(string $name)

Checks if the given tag name represents a void (empty) HTML element.

static bool
isUrlAttribute(string $tag, string $attr)

Determines if the given HTML attribute is a URL attribute that requires special handling.

static string
classifyScriptType(string $type)

Classifies script content type based on the MIME type.

static string
validateTagChange(mixed $name, string|null $origName = null)

Checks that the HTML tag name can be changed.

Details

at line 26
static bool isVoidElement(string $name)

Checks if the given tag name represents a void (empty) HTML element.

Parameters

string $name

Return Value

bool

at line 39
static bool isUrlAttribute(string $tag, string $attr)

Determines if the given HTML attribute is a URL attribute that requires special handling.

Parameters

string $tag
string $attr

Return Value

bool

at line 50
static string classifyScriptType(string $type)

Classifies script content type based on the MIME type.

Parameters

string $type

Return Value

string

at line 66
static string validateTagChange(mixed $name, string|null $origName = null)

Checks that the HTML tag name can be changed.

Parameters

mixed $name
string|null $origName

Return Value

string