abstract class AbstractComponent

Class AbstractComponent

Traits

Trait MagicTrait. Contains magic methods: setter, getter, isset, call and has To reduce code on pure PHP classes with good practices and recomendations.

Properties

string $id ID tag for the component.
string $name Name tag for the component.
string $class Class tag for the component.
string $style Class style for the component.

Methods

bool
__isset(string $key)

Magic isset.

from MagicTrait
mixed|null
__get(string $key)

Magic getter.

from MagicTrait
__set(string $key, mixed $value)

Magic setter.

from MagicTrait
$this|bool|mixed|string|null
__call(string $method, array $params)

Intercepts calls to non-existent getters / setters Looks at the beginning of $method to see if it's "get", "set", "has" Uses preg_match() to extract the 2nd part of the match, which should produce the property name

from MagicTrait
__construct($parameters)

AbstractComponent constructor.

string
toHtml()

Return this component rendered.

string
getTemplatePath()

Return the template path to render this component.

array
toArray()

Returns this object public properties to array.

Details

in MagicTrait at line 26
bool __isset(string $key)

Magic isset.

Parameters

string $key

Return Value

bool

in MagicTrait at line 38
mixed|null __get(string $key)

Magic getter.

Parameters

string $key

Return Value

mixed|null

in MagicTrait at line 51
__set(string $key, mixed $value)

Magic setter.

Parameters

string $key
mixed $value

in MagicTrait at line 72
$this|bool|mixed|string|null __call(string $method, array $params)

Intercepts calls to non-existent getters / setters Looks at the beginning of $method to see if it's "get", "set", "has" Uses preg_match() to extract the 2nd part of the match, which should produce the property name

Parameters

string $method
array $params

Return Value

$this|bool|mixed|string|null

Exceptions

RuntimeException

at line 55
__construct($parameters)

AbstractComponent constructor.

Parameters

$parameters

at line 71
string toHtml()

Return this component rendered.

Return Value

string

at line 81
abstract string getTemplatePath()

Return the template path to render this component.

Return Value

string

at line 88
array toArray()

Returns this object public properties to array.

Return Value

array $array populated array