yii2-bootstrap icon indicating copy to clipboard operation
yii2-bootstrap copied to clipboard

Nav can not set active class

Open neilqin opened this issue 8 years ago • 1 comments
trafficstars

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

neilqin avatar Aug 10 '17 06:08 neilqin

Already faced this.

machour avatar Jan 15 '19 10:01 machour