\Disco\classesHtml

This is the Html class.

It helps you build html elements with a logical and simple syntax. This class doesn't not contain any actual methods, but instead using the magic method __call($method,$args) we can build any specified html element from a mocked method. For example: $img = Html::img(Array('src'=>'/example.png')); $div = Html::div('cool div');

Summary

Methods
Properties
Constants
__call()
push()
$stack
No constants found
No protected methods found
$base
$noCloseBase
$prop
$noClose
N/A
No private methods found
No private properties found
N/A

Properties

$stack

$stack : boolean

Type

boolean — Wil the next built element be pushed onto the current application Views stack.

$base

$base : string

Type

string — The base string we build markup from.

$noCloseBase

$noCloseBase : string

Type

string — The base string we build markup from for elements that are singletons or non closing.

$prop

$prop : string

Type

string — The base string we build a single properties from.

$noClose

$noClose : Array

Type

Array — Html elements that are singletons and do not use a closing tag.

Methods

__call()

__call(string  $method, Array  $args) : string

The magic method __call() allows us to treat any method that is called as the intented html element to be created.

If $args[0] is an Array then $args[0] will be treated as properties to be included on the element containing content specified in $args[1]. Otherwise $args[0] will be treated as the content of the element.

Parameters

string $method

The method name called and also the intented html element to return.

Array $args

The arguements passed to $method.

Returns

string

push()

push() : self

If called in the begging of the method chain it will push the built html onto the current applications View html stack.

Returns

self