yii2-bootstrap
yii2-bootstrap copied to clipboard
Nav can not set active class
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 |
Already faced this.