katiemac
New member
I've created a PHP function named displayNav($i) and pass it the variable $i.
This function is responsible for rendering a navigation bar at the top of my web pages.
I want to apply the active class to the appropriate href tag based on the page the user is currently on,
as illustrated in the attached file.
I feel there is a more efficient way to do this, but I'm having trouble finding a better solution.
Any advice would be greatly appreciated!
Thank you.
This function is responsible for rendering a navigation bar at the top of my web pages.
I want to apply the active class to the appropriate href tag based on the page the user is currently on,
as illustrated in the attached file.
I feel there is a more efficient way to do this, but I'm having trouble finding a better solution.
Any advice would be greatly appreciated!
Thank you.