How can I set class=“active” to navigation menu in codeigniter?

后端 未结 4 1418
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-09 18:23

I just start up to be a web developer. Now I create a dynamic website for the first time. I don\'t know how to set class=\"active\" to the navigation menu. Here is

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-09 19:06

    I do this on most projects. How I achieve this is like this;

     List Patients
    

    It's matching the current uri string, with the links href. If it matches, it add's an active class to the link.

    Hope this helps.

    I have also used site_url over base_url

提交回复
热议问题