component multi render from which version? {control login-quick} nebo {control login-default}
Notice: This thread is very old.
- Filip Procházka
- Moderator | 4668
There is nothing like that in nette and never was. This is the only way to do what you want.
protected function createComponentLogin()
{
return new UI\Multiplier(function ($name) {
$control = new Something;
$control->setView($name);
return $control;
});
}
class Something extends UI\Control
{
private $view = 'default';
public function setView($view) { $this->view = $view; }
public function render()
{
call_user_func_array(array($this, 'render' . $this->view), func_get_args());
}
}
Or, you can use the standard way that is in Nette like forever
{control login:quick}
which will translate in template to
$presenter['login']->renderQuick();