In Ruby (forgive me for mentioning it’s name) I noticed you could do a anchor link with ‘link to unless current’, which would remove the link if it was the current page.
I know there’s nothing built into CodeIgniter to do something similar, but I’m trying to come up with the best way to do this. I’ve got a few options, but they’re all too long and cumbersome. Does anyone have any ideas (maybe using the URI segment)?
Why not write your own helper that follows the html helper link_tag checker… put one more condition inside there to check if your in the current controller. Looking at codeIgniter with xdebug, the object returned by get_instance provides access to pretty much everything the controller had. so ci->router->uri->rsegments could be used to check for your controller action.
Edit: Sorry forgot the ‘uri’ part in that chain above.