Hi,
Jojo_44 wrote:ok thanks. Your code isn´t working out of the box because the path of renderSubView() always starts at the view you call the function. F.e. if you call renderSubView('\MyProject\Views\Navigation') from \MyProject\Views\Home it produces the path "\MyProject\Views\Home\\MyProject\Views\Navigation" ->ofc error. So your Navigation must be loacted in your view folder where you call renderSubView ?
Actually, the parameter passed to renderSubView() is a class name starting from the current namespace. So is you call renderSubView('Navigation'), Navigation need to be in the same folder than your view. The function always add the current namespace in front of the parameter. Maybe it's something to improve by the way so a absolute namespace can be use instead.
1. You need to call setManialink directly on lastItem, it will pass it to every element composing the button (and you can't do it another way):
- Code: Select all
$ui->addItem();
$ui->lastItem->text->setText('MenuItem1');
$manialink = $this->request->createLink('/home');
$ui->lastItem->setManialink($manialink);
2. No, it isn't set automatically because it can be used whether to close the manialink explorer, or to go to a main page or wherever you want.