Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nav can not set active class #209

Open
neilqin opened this issue Aug 10, 2017 · 1 comment
Open

Nav can not set active class #209

neilqin opened this issue Aug 10, 2017 · 1 comment
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement
Milestone

Comments

@neilqin
Copy link

neilqin commented Aug 10, 2017

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
@samdark samdark added the status:to be verified Needs to be reproduced and validated. label Aug 10, 2017
@samdark samdark added this to the 2.0.8 milestone Aug 10, 2017
@machour machour added status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement and removed status:to be verified Needs to be reproduced and validated. labels Jan 15, 2019
@machour
Copy link
Member

machour commented Jan 15, 2019

Already faced this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants