Html
extends KBase
in package
HTML class
Tags
Table of Contents
- $attributes : array<string|int, mixed>
- Tag attributes
- $form : Form
- Form object variable
- $cfg : object
- Config class instance.
- $javascript : array<string|int, mixed>
- JavaScript
- $request : Request
- Server request class instance.
- $rows : array<string|int, mixed>
- Array of data within the tag
- $tag : string
- Tag name
- __construct() : mixed
- Class constructor
- add() : static
- Insert a tag into the element like using innerHTML
- appendChild() : mixed
- Append HTML to the element at the end position
- create() : static
- Create a new Element
- fieldset() : self
- Create a fieldset element.
- form() : self
- Create a form element.
- innerHtml() : string
- Generate an HTML element with the specified inner HTML content.
- render() : string
- Render the HTML markup for the form or element.
- script() : mixed
- Add a JavaScript script to the form or the current instance.
- renderAttributes() : string
- Render the attributes of the HTML tag as a string.
- addCKEditor() : static
- Add a CKEditor element to the HTML.
- addGroups() : static
- Add a groups element to the HTML.
- addInputGroups() : static
- Add an input groups element to the HTML.
- addMenuButton() : static
- Add a menu button element to the HTML.
- addRadioOrCheckbox() : static
- Add a radio or checkbox groups element to the HTML.
Properties
$attributes
Tag attributes
public
array<string|int, mixed>
$attributes
$form
Form object variable
public
static Form
$form
$cfg
Config class instance.
protected
static object
$cfg
$javascript
JavaScript
protected
array<string|int, mixed>
$javascript
$request
Server request class instance.
protected
static Request
$request
$rows
Array of data within the tag
protected
array<string|int, mixed>
$rows
$tag
Tag name
protected
string
$tag
Methods
__construct()
Class constructor
public
__construct(mixed $tag[, mixed $attributes = [] ]) : mixed
Parameters
- $tag : mixed
- $attributes : mixed = []
Return values
mixed —add()
Insert a tag into the element like using innerHTML
public
add(string $tag[, array<string|int, mixed> $attributes = [] ]) : static
Parameters
- $tag : string
- $attributes : array<string|int, mixed> = []
Return values
static —appendChild()
Append HTML to the element at the end position
public
appendChild(string $html) : mixed
Parameters
- $html : string
Return values
mixed —create()
Create a new Element
public
static create(string $tag[, array<string|int, mixed> $attributes = [] ]) : static
Parameters
- $tag : string
- $attributes : array<string|int, mixed> = []
Return values
static —fieldset()
Create a fieldset element.
public
static fieldset([array<string|int, mixed> $attributes = [] ]) : self
Parameters
- $attributes : array<string|int, mixed> = []
-
The attributes of the fieldset element.
Return values
self —The created fieldset element.
form()
Create a form element.
public
static form([array<string|int, mixed> $attributes = [] ]) : self
Parameters
- $attributes : array<string|int, mixed> = []
-
The attributes of the form element.
Return values
self —The created form element.
innerHtml()
Generate an HTML element with the specified inner HTML content.
public
innerHtml(string $html) : string
Parameters
- $html : string
-
The inner HTML content.
Return values
string —The generated HTML markup.
render()
Render the HTML markup for the form or element.
public
render() : string
Return values
string —The rendered HTML markup.
script()
Add a JavaScript script to the form or the current instance.
public
script(string $script) : mixed
Parameters
- $script : string
-
The JavaScript script to add.
Return values
mixed —renderAttributes()
Render the attributes of the HTML tag as a string.
protected
renderAttributes() : string
Return values
string —The rendered attributes.
addCKEditor()
Add a CKEditor element to the HTML.
private
addCKEditor(string $tag, array<string|int, mixed> $attributes) : static
Parameters
- $tag : string
-
The tag name.
- $attributes : array<string|int, mixed>
-
The attributes of the element.
Return values
static —The added CKEditor element.
addGroups()
Add a groups element to the HTML.
private
addGroups(string $tag, array<string|int, mixed> $attributes) : static
Parameters
- $tag : string
-
The tag name.
- $attributes : array<string|int, mixed>
-
The attributes of the element.
Return values
static —The added groups element.
addInputGroups()
Add an input groups element to the HTML.
private
addInputGroups(array<string|int, mixed> $attributes) : static
Parameters
- $attributes : array<string|int, mixed>
-
The attributes of the element.
Return values
static —The added input groups element.
addMenuButton()
Add a menu button element to the HTML.
private
addMenuButton(array<string|int, mixed> $attributes) : static
Parameters
- $attributes : array<string|int, mixed>
-
The attributes of the element.
Return values
static —The added menu button element.
addRadioOrCheckbox()
Add a radio or checkbox groups element to the HTML.
private
addRadioOrCheckbox(string $tag, array<string|int, mixed> $attributes) : static
Parameters
- $tag : string
-
The tag name ('radiogroups' or 'checkboxgroups').
- $attributes : array<string|int, mixed>
-
The attributes of the element.
Return values
static —The added radio or checkbox groups element.