PHP Class Redaxscript\Html\Element

Since: 2.6.0
Author: Henry Ruhs
Inheritance: extends HtmlAbstract
Show file Open project: redaxmedia/redaxscript Class Usage Examples

Protected Properties

Property Type Description
$_attributeArray array attributes of the element
$_singletonTags array array of singleton tags
$_tag string tag of the element

Public Methods

Method Description
__toString ( ) : string stringify the element
addClass ( string $className = null ) : Element add class to the element
attr ( mixed $attribute = null, string $value = null ) : Element set attribute to the element
copy ( ) : Element copy the element
init ( string $tag = null, array $attributeArray = [] ) : Element init the class
removeAttr ( string $attribute = null ) : Element remove attribute from the element
removeClass ( string $className = null ) : Element remove class from the element
render ( ) : string render the element
text ( string $text = null ) : Element set text to the element
val ( string $value = null ) : Element set value to the element

Protected Methods

Method Description
_editClass ( string $className = null, string $type = null ) : Element edit class helper

Method Details

__toString() public method

stringify the element
Since: 2.2.0
public __toString ( ) : string
return string

_editClass() protected method

edit class helper
Since: 2.2.0
protected _editClass ( string $className = null, string $type = null ) : Element
$className string name of the classes
$type string add or remove
return Element

addClass() public method

add class to the element
Since: 2.2.0
public addClass ( string $className = null ) : Element
$className string name of the classes
return Element

attr() public method

set attribute to the element
Since: 2.2.0
public attr ( mixed $attribute = null, string $value = null ) : Element
$attribute mixed name or set of attributes
$value string value of the attribute
return Element

copy() public method

copy the element
Since: 2.2.0
public copy ( ) : Element
return Element

init() public method

init the class
Since: 2.2.0
public init ( string $tag = null, array $attributeArray = [] ) : Element
$tag string tag of the element
$attributeArray array attributes of the element
return Element

removeAttr() public method

remove attribute from the element
Since: 2.2.0
public removeAttr ( string $attribute = null ) : Element
$attribute string name of attributes
return Element

removeClass() public method

remove class from the element
Since: 2.2.0
public removeClass ( string $className = null ) : Element
$className string name of the classes
return Element

render() public method

render the element
Since: 2.2.0
public render ( ) : string
return string

text() public method

set text to the element
Since: 2.2.0
public text ( string $text = null ) : Element
$text string text of the element
return Element

val() public method

set value to the element
Since: 2.2.0
public val ( string $value = null ) : Element
$value string value of the element
return Element

Property Details

$_attributeArray protected property

attributes of the element
protected array $_attributeArray
return array

$_singletonTags protected property

array of singleton tags
protected array $_singletonTags
return array

$_tag protected property

tag of the element
protected string $_tag
return string