How to add "active" class in menu for show method?



  • How to add "active" class in menu for show method?



  • Solved a problem by creating a presenter with a method that checks for the first segment of URL

    public function getActiveState($item)
    {
    return \Request::segment(1) == $item->getRequest() ? ' class="active"' : null;
    }

    if someone know a better solution, please right it


Log in to reply