\Hazaar\Html
Block
Block HTML display element

Generic base class for an HTML block element. This class will render any block element of the defined type along with any child elements that have been set as it’s contents.

Tags

Since

1.0.0

Summary
Methods Properties Constants
add
get
key
set
No constants
Properties
$close
$close
$content
$content
$type
$type
Methods
__construct()
__construct($type, $content = null, $parameters = Array ( ) , $close = true)

The HTML block element constructor. This allows a block element of any type to be constructed.

Tags

Since

1.0.0

Parameters

$typestring

The type of the element.

$contentmixed

Any content to add to the element. Content can be a string, an integer, another HTML element, or an array of any depth containing a mix of strings and HTML elements.

$parametersarray

An array of parameters to apply to the block element.

$close\Hazaar\Html\bool

Sets whether to close the block. Sometimes some fancy things need to happen inside a block so we can request that the block no be closed. This is usually used inside a view to allow a block to be displayed in code, then using ‘?>’

escape sequence to drop the PHP interpreter back into HTML output mode to render more content that will appear inside the block.

add()
add() : \\Hazaar\\Html\\Block

Add one or more elements to the contents of the block.

Tags

Since

1.0.0

children()
children()
count()
count()
current()
current()
get()
get() : array

Get the contents of the block.

Tags

Since

2.0.0

Returns

array
key()
key()
next()
next()
offsetExists()
offsetExists($key)

Parameters

$key

No description

offsetGet()
offsetGet($key)

Parameters

$key

No description

offsetSet()
offsetSet($key, $value)

Parameters

$key

No description

$value

No description

offsetUnset()
offsetUnset($key)

Parameters

$key

No description

prepend()
prepend($element) : \\Hazaar\\Html\\Block

Prepend an element to the beginning of the contents.

Tags

Since

1.0.0

Parameters

$element

No description

Returns

\\Hazaar\\Html\\Block
renderElement()
renderElement($element) : string

Recursively render a child element.

Tags

Since

1.0.0

Parameters

$elementmixed

The element to render. Can be anything that can be converted to a string, or an array of other elements.

Returns

string
renderObject()
renderObject() : string

Render the current object as an HTML string.

Tags

Since

1.0.0

Returns

string
rewind()
rewind()
set()
set() : \\Hazaar\\Html\\Block

Set one or more elements as the contents of the block.

Tags

Since

1.0.0

valid()
valid()