class Html

Html builder

Methods

static string
createId(string $text, string $separator = '-')

Create valid html element id

static string
htmlTag(string $name, string|null $content, array|null $attributes = null, bool $singleTag = false, bool $startTagOnly = false)

Get html tag code

static mixed
__callStatic(string $name, array $arguments)

Call static methods

static string
getAttributes(array|null $attributes)

Convert attributes array to string

static string
attr(string|null $value, string|null $name = null, string|null $default = null)

Get html attribute

static string
singleTag(string $name, array|null $attributes = null)

Get html single tag

static string
startTag(string $name, array|null $attributes = null)

Get html start tag

static string
endTag(string $name, string|null $content = '')

Get html end tag

static string
specialcharsDecode(string $value)

Decode html chars

static string|null
removeTags(string $text, string|array $tags)

Remove html gams from text

static void
startDocument()

Start html

static void
renderDocument()

Show html code

static string
getDocument()

Get html code

static void
appendHtml(string $html)

Append html code

Details

at line 38
static string createId(string $text, string $separator = '-')

Create valid html element id

Parameters

string $text
string $separator

Return Value

string

at line 58
static string htmlTag(string $name, string|null $content, array|null $attributes = null, bool $singleTag = false, bool $startTagOnly = false)

Get html tag code

Parameters

string $name
string|null $content
array|null $attributes
bool $singleTag
bool $startTagOnly

Return Value

string

at line 84
static mixed __callStatic(string $name, array $arguments)

Call static methods

Parameters

string $name
array $arguments

Return Value

mixed

at line 107
static string getAttributes(array|null $attributes)

Convert attributes array to string

Parameters

array|null $attributes

Return Value

string

at line 129
static string attr(string|null $value, string|null $name = null, string|null $default = null)

Get html attribute

Parameters

string|null $value
string|null $name
string|null $default

Return Value

string

at line 143
static string singleTag(string $name, array|null $attributes = null)

Get html single tag

Parameters

string $name
array|null $attributes

Return Value

string

at line 155
static string startTag(string $name, array|null $attributes = null)

Get html start tag

Parameters

string $name
array|null $attributes

Return Value

string

at line 167
static string endTag(string $name, string|null $content = '')

Get html end tag

Parameters

string $name
string|null $content

Return Value

string

at line 178
static string specialcharsDecode(string $value)

Decode html chars

Parameters

string $value

Return Value

string

at line 190
static string|null removeTags(string $text, string|array $tags)

Remove html gams from text

Parameters

string $text
string|array $tags

Return Value

string|null

at line 206
static void startDocument()

Start html

Return Value

void

at line 217
static void renderDocument()

Show html code

Return Value

void

at line 227
static string getDocument()

Get html code

Return Value

string

at line 238
static void appendHtml(string $html)

Append html code

Parameters

string $html

Return Value

void