\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
Methods
__construct()
__construct($type = null, $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. If this is NULL then the block will not generate any

                         HTML tags.  This is useful if you need a logical container for other elements.
$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.

$closebool

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

after()
after($selector, $content)

Parameters

$selector

No description

$content

No description

before()
before($selector, $content)

Parameters

$selector

No description

$content

No description

children()
children($selector = null)

Parameters

$selector

No description

count()
count()
current()
current()
find()
find($selector = null)

Parameters

$selector

No description

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
replace()
replace($selector, $content)

Parameters

$selector

No description

$content

No description

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

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

Tags

Since

1.0.0

spliceElement()
spliceElement($selector, $content, $offset, $length = 0)

Parameters

$selector

No description

$content

No description

$offset

No description

$length

No description

valid()
valid()