HtmlElementBsButton
extends HtmlElementBs
in package
Table of Contents
Properties
- $badge : mixed
- $icon : mixed
- $parent : mixed
- $spinner : mixed
- $attributes : mixed
- $content : mixed
- $params : mixed
- $tag : mixed
- $tags : mixed
- $type : mixed
Methods
- __construct() : mixed
- attributes() : HtmlElement
- Add new attributes to element
- badge() : HtmlElementBsButton
- Child: badge
- childContent() : mixed
- collapse() : mixed
- content() : string
- Set the element content and return the formated element as a string
- dispatch() : mixed
- Display the content
- element() : object
- Call a new class which extend current HtmlElementClass
- icon() : mixed
- parseParam() : mixed
- popover() : mixed
- spinner() : mixed
- tag() : HtmlElement
- Instantiate a new object using tag name
- toggle() : mixed
- tooltip() : mixed
- use() : string
- Return the formated element as a string
- child() : HtmlElement
- Instantiate a child element
- parseAttributes() : string
- Convert Attributes from array to a scring
- parseContent() : string|array<string|int, mixed>|null
- Convert the content from array to string
- setAttrClass() : mixed
- setAttributeByParam() : mixed
- getTemplateByTag() : string
- Return the template use to format the element
- parseParams() : mixed
- setAttributeActive() : mixed
- setAttributeByTag() : mixed
- setAttributeDisabled() : mixed
- setAttributeId() : mixed
- setAttributeNowrap() : mixed
- setAttributes() : mixed
- setAttributeSize() : mixed
- setAttributeToggle() : mixed
- setAttributeVariant() : mixed
- setContent() : mixed
Properties
$badge
public
mixed
$badge
$icon
public
mixed
$icon
$parent
public
mixed
$parent
$spinner
public
mixed
$spinner
$attributes
protected
mixed
$attributes
$content
protected
mixed
$content
$params
protected
mixed
$params
$tag
protected
mixed
$tag
$tags
private
mixed
$tags
= ['a', 'btn', 'input']
$type
private
mixed
$type
= ['button', 'submit', 'reset']
Methods
__construct()
public
__construct([array<string|int, mixed>|string $params = [] ]) : mixed
Parameters
- $params : array<string|int, mixed>|string = []
-
the values are optional and must be: |- active = true|false |- badge = HtmlElementBsBadge properties |- disabled = true|false |- icon = bs icon name | HtmlElementBsIcon properties |- nowrap = true|false |- size = $size |- spinner = HtmlElementBsSpinner properties |- tag = $tags |- text = string |- toggle - true|false |- type = $type |- variant = BS_COLORS + link
attributes()
Add new attributes to element
public
attributes([array<string|int, mixed>|null $attributes = [] ][, bool $mergeValues = true ]) : HtmlElement
Parameters
- $attributes : array<string|int, mixed>|null = []
-
The the attributes must be included in one array, each member having any of the following format:
- single attribute: $attributes = ['disabled']
- associative: $atributes = ['type'=>'input', 'value'=>3]
- associative multiple keys: $attributes = ['data' => ['role' => 'content', 'content' => 'button']]
- assocuative multiple values: $attributes = ['class' => 'btn btn-sm']
- $mergeValues : bool = true
-
- merge new values true | false
Return values
HtmlElementbadge()
Child: badge
public
badge(null|string|array<string|int, mixed> $params) : HtmlElementBsButton
Parameters
- $params : null|string|array<string|int, mixed>
-
|- bg-color = background color = an element of AVI_BS_COLOR |- color = textcolor = an element of AVI_BS_COLOR |- pill = rounded margins like a pill = true | false |- text = string
Return values
HtmlElementBsButtonchildContent()
public
childContent(mixed $name[, mixed $return = false ]) : mixed
Parameters
- $name : mixed
- $return : mixed = false
collapse()
public
collapse([mixed $params = [] ]) : mixed
Parameters
- $params : mixed = []
content()
Set the element content and return the formated element as a string
public
content([array<string|int, mixed>|string|null $content = null ][, mixed $return = false ]) : string
Parameters
- $content : array<string|int, mixed>|string|null = null
- $return : mixed = false
Return values
stringdispatch()
Display the content
public
dispatch([array<string|int, mixed>|string|null $content = null ]) : mixed
Parameters
- $content : array<string|int, mixed>|string|null = null
element()
Call a new class which extend current HtmlElementClass
public
element(string $element[, array<string|int, mixed>|string $properties = [] ][, mixed $root = null ]) : object
Parameters
- $element : string
-
- defined element
- $properties : array<string|int, mixed>|string = []
- $root : mixed = null
Return values
object —defeined in extended class
icon()
public
icon(mixed $params) : mixed
Parameters
- $params : mixed
parseParam()
public
parseParam(mixed $key[, mixed $default = null ]) : mixed
Parameters
- $key : mixed
- $default : mixed = null
popover()
public
popover([mixed $params = [] ]) : mixed
Parameters
- $params : mixed = []
spinner()
public
spinner(mixed $params) : mixed
Parameters
- $params : mixed
tag()
Instantiate a new object using tag name
public
tag(mixed $tag[, mixed $attributes = null ][, mixed $newElement = true ][, mixed $instance = null ]) : HtmlElement
Parameters
- $tag : mixed
-
element tag
- $attributes : mixed = null
- $newElement : mixed = true
- $instance : mixed = null
Return values
HtmlElementtoggle()
public
toggle(mixed $params) : mixed
Parameters
- $params : mixed
tooltip()
public
tooltip(mixed $data) : mixed
Parameters
- $data : mixed
use()
Return the formated element as a string
public
use() : string
Return values
stringchild()
Instantiate a child element
protected
child(string $name, string $type[, array<string|int, mixed> $defaultAttributes = [] ]) : HtmlElement
Parameters
- $name : string
-
- the child name
- $type : string
-
- the element type | html-tag
- $defaultAttributes : array<string|int, mixed> = []
Return values
HtmlElementparseAttributes()
Convert Attributes from array to a scring
protected
parseAttributes() : string
Return values
stringparseContent()
Convert the content from array to string
protected
parseContent() : string|array<string|int, mixed>|null
Return values
string|array<string|int, mixed>|nullsetAttrClass()
protected
setAttrClass(mixed $value[, mixed $merge = true ]) : mixed
Parameters
- $value : mixed
- $merge : mixed = true
setAttributeByParam()
protected
setAttributeByParam(mixed $key) : mixed
Parameters
- $key : mixed
getTemplateByTag()
Return the template use to format the element
private
getTemplateByTag() : string
Return values
stringparseParams()
private
parseParams() : mixed
setAttributeActive()
private
setAttributeActive() : mixed
setAttributeByTag()
private
setAttributeByTag() : mixed
setAttributeDisabled()
private
setAttributeDisabled() : mixed
setAttributeId()
private
setAttributeId() : mixed
setAttributeNowrap()
private
setAttributeNowrap() : mixed
setAttributes()
private
setAttributes() : mixed
setAttributeSize()
private
setAttributeSize() : mixed
setAttributeToggle()
private
setAttributeToggle() : mixed
setAttributeVariant()
private
setAttributeVariant() : mixed
setContent()
private
setContent() : mixed