Codeigniter-Bootstrap icon indicating copy to clipboard operation
Codeigniter-Bootstrap copied to clipboard

set_active_nav ()

Open jorgejeferson opened this issue 11 years ago • 2 comments

Friend, I have a problem and still do not know how to solve, could you help me? in option: set_active_nav (''), if he does not select a parameter field how can I solve this. Thank you.

jorgejeferson avatar Apr 02 '13 14:04 jorgejeferson

The set_active_nav($url) helper simply checks if the given $url matches the current active route, i.e. the page that the user is viewing. If true then the function will return the string class="active"so that the approriate item in the navigation/menu is set active. Else, it returns an empty string.

I'm sure there are more elegant ways to do this, but it does the job.

modbase avatar Apr 02 '13 16:04 modbase

I liked the idea that was, but I'll break your head a bit here, because I have this example: set_active_nav('admin/users') but when I use pagination url leaves users/ to users/2 so it loses reference , you know? but thanks.

jorgejeferson avatar Apr 02 '13 17:04 jorgejeferson