Nesting

Create method for add child

Info Three ways.
public function addChild($name)
{
    $control = new \Mesour\UI\Control;
    $this[$name] = $control;

    //or

    //$this->addComponent($control, $name);

    //or

    //$control = new \Mesour\UI\Control($name, $this);
    return $control;
}

Using getParent methods

public function render()
{
    echo $this->getParent()->getName();
}

Iterate on childrens

public function render()
{
    foreach($this->getContainer() as $name => $control) {
        /** @var \Mesour\UI\Control $control */
        // $name === $control->getName();
        echo $control->getName();
    }
}

Get component

public function render()
{
    $control = $this->getContainer()->getComponent($name);

    //or

    //$control = $this[$name];

    // change something on $control
    echo $control->render();
}