Skip to content

Nav can not set active class #209

@neilqin

Description

@neilqin

What steps will reproduce the problem?

when i set menu item below:

    $menuItemsleft = [
        ['label' => 'Home', 'url' => ['/site/index']],
        ['label' => 'flow', 'url' => ['/flow']],
        ['label' => 'form', 'url' => ['/form']],
    ];

i access route /form/add,这flow item can not set active class

What's expected?

What do you get instead?

i add below code to Nav.php=>isItemActive() before code " if (ltrim($route, '/') !== $this->route) {"
if (strpos('/'.$this->route, $route) === 0) {
return true;
}

can you will add this code to improve it?

Additional info

Q A
Yii version
PHP version
Operating system

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions