Yii2 如何创建指向详细视图的菜单项

Yii2 How can I create a Menu item pointing to a detail view

我使用 Yii2 的典型前端菜单。通常根据 main.php 的菜单项如

$menuItems[] = [
        ['label' => 'Home', 'url' => ['/site/index']],
        ['label' => 'About', 'url' => ['/site/about']],
        ['label' => 'Contact', 'url' => ['/site/contact']],
    ];

在指向详细视图的情况下,这是行不通的。我无法使用

$menuItems[] = [
            ['label' => 'Member', 'url' => ['/member/view' . '&id=' . $id]],

这也不起作用

$menuItems = [
['label' => 'Member', 'url' => Url::to('member/view', ['id' => $id])],

如何从菜单项指向详细视图?

应该是

$menuItems[] = ['label' => 'Member', 'url' => ['/member/view', 'id' => $id]],