\Hazaar\Html
Input
The HTML input class.

Displays an HTML <input> element.

Tags

Since

1.1

Summary
Methods Properties Constants
No constants
Properties
$datalist
$datalist
Inherited
$style
$style
Inherited
$type
$type
Methods
__construct()
__construct($type, $name, $value = null, $parameters = Array ( ) )

The HTML form constructor.

Tags

Since

1.1

Parameters

$typemixed

The input type can be button, checkbox, color, date, datetime, datetime-local, email, file, hidden, image, month, number, password, radio, range, reset, search, submit, tel, text, time, url or week.

$namestring

The name of the input field.

$valuemixed

Specifies the value of the input element.

$parametersarray

Optional parameters to apply to the anchor.

datalist()
datalist($datalist)

Parameters

$datalist

No description

renderObject()
renderObject()
Inherited
__set()
__set($key, $value) : \\Hazaar\\Html\Element

Set a parameter on the current HTML element

Tags

Since

1.0.0

Parameters

$keystring

The name of the parameter to set.

$value

No description

Returns

\\Hazaar\\Html\Element

Returns a ref to self.

Inherited
__tostring()
__tostring() : string

Magic method to convert the element to a string.

Calls the methods renderObject() method to render the object as a string.

Tags

Since

1.0.0

Returns

string
Inherited
addClass()
addClass($class) : $this
Adds a class to the HTML element

Parameters

$classstring

No description

Returns

\Hazaar\Html\this
Inherited
asHtml()
asHtml() : string

Render the element as HTML using ascii special characters. This allows elements to easily be displayed without being rendered in the browser. Great for use inside

 elements.

Tags

Since

1.0.0

Returns

string
Inherited
attr()
attr($key, $value = null) : \\Hazaar\\Html\Element

Get/Set an attribute on the current HTML element

Tags

Since

1.0.0

Parameters

$keystring

The name of the parameter to set.

$value

No description

Returns

\\Hazaar\\Html\Element

Returns a ref to self.

Inherited
data()
data($key, $value)

Parameters

$key

No description

$value

No description

Inherited
hasClass()
hasClass($class) : bool
Test if a class has been added to an HTML element

Parameters

$classstring

The class to check for

Returns

\Hazaar\Html\bool

TRUE if the class has been set

Inherited
parameters()
parameters()
Inherited
prop()
prop($key, $enabled = true) : Element
Enable or disable a property.

Some element types have properties that have no value. A good example is “checked” on a checkbox or radio, or “enabled” on an input. This method allows these properties to be added or removed without requiring a value.

Parameters

$keystring

The property to set on the element.

$enabledboolean

If TRUE the property will be added. If FALSE the property will not be added or it will be removed if it already exists.

Returns

\Hazaar\Html\Element
Inherited
style()
style()
Inherited
toggleClass()
toggleClass($class, $boolean = false) : $this;
Set's a class based on a boolean value.

This is handy for adding a class only if a boolean value is true and can be used as shorthand in place of in ‘if’ statement that selectively adds the class as this may not be desired in a view.

Parameters

$class

No description

$boolean

No description

Returns

\Hazaar\Html\this