Avi documentation

HtmlElementBsDropdown extends HtmlElement
in package

Table of Contents

Properties

$button  : mixed
$menu  : mixed
$parent  : mixed
$attributes  : mixed
$content  : mixed
$params  : mixed
$tag  : mixed
$direction  : mixed
$directions  : mixed
$drop  : mixed
$drops  : mixed

Methods

__construct()  : HtmlElementBsDropdown
attributes()  : HtmlElement
Add new attributes to element
button()  : mixed
childContent()  : 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
menu()  : mixed
parseParam()  : mixed
tag()  : HtmlElement
Instantiate a new object using tag name
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
baseClass()  : mixed
buttonData()  : mixed
getTemplateByTag()  : string
Return the template use to format the element
menuClass()  : mixed
menuItem()  : mixed
parseParams()  : mixed
setAttributes()  : mixed
setContent()  : mixed
setMenuItems()  : mixed

Properties

Methods

__construct()

public __construct([array<string|int, mixed> $params = [] ]) : HtmlElementBsDropdown
Parameters
$params : array<string|int, mixed> = []

the values are optional and must be: |- autoclose = true | inside | outside | false Auto close behavior |- button = the trigger bs button element, arrow in case of split |- dark = false | true = menu is dark |- direction = the menu display direction |- drop = down | end | start | up - the drop direction |- menu = the bs element of menu |- align (end | start | end + start responsive) |- items = array of items (type, text, active, disabled) |- button (text, type = button) |- header (text, type = header) |- html (content, type = html) |- link (href, type = link, text) |- separator (tag, type = separator) |- text (text, type = text) |- tag (default is ul - also is set based on item types) |- offset = false | $value in pixels |- reference = false | parent |- split = the bs button split -

Return values
HtmlElementBsDropdown

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
HtmlElement

button()

public button([mixed $params = 'Dropdown button' ]) : mixed
Parameters
$params : mixed = 'Dropdown button'

childContent()

public childContent(mixed $name[, mixed $return = false ]) : mixed
Parameters
$name : mixed
$return : mixed = false

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
string

dispatch()

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

parseParam()

public parseParam(mixed $key[, mixed $default = null ]) : mixed
Parameters
$key : mixed
$default : mixed = null

tag()

Instantiate a new object using tag name

public tag(string|null $tag[, mixed $attributes = null ][, mixed $newElement = true ][, mixed $instance = null ]) : HtmlElement
Parameters
$tag : string|null

element tag

$attributes : mixed = null
$newElement : mixed = true
$instance : mixed = null
Return values
HtmlElement

use()

Return the formated element as a string

public use() : string
Return values
string

child()

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
HtmlElement

parseAttributes()

Convert Attributes from array to a scring

protected parseAttributes() : string
Return values
string

parseContent()

Convert the content from array to string

protected parseContent() : string|array<string|int, mixed>|null
Return values
string|array<string|int, mixed>|null

setAttrClass()

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
string

menuItem()

private menuItem([array<string|int, mixed>|string $item = [] ]) : mixed
Parameters
$item : array<string|int, mixed>|string = []

        
On this page

Search results