Events

How to use

1. Create public or protected property starts with "on"

Important Property must contains array.
class Span extends \Mesour\UI\Control
{

    public $onRender = array();

}

2. Somewhere trigger this event

Info Can use one or more own parameters.
public function render()
{
    $this->onRender($this);
    echo '';
}

3. Complete source code

class Span extends \Mesour\UI\Control
{

    public $onRender = array();

    public function render()
    {
        $this->onRender($this);
        echo '';
    }

}

Usage

$span = new \Span();

$span->onRender[] = function(\Span $span) {
    // change something on $span
};

$span->render();