Welcome Guest, Not a member yet? Register   Sign In
New to CI, have some questions
#4

[eluser]xwero[/eluser]
Of course adamp1 that is even simpler
Code:
function set_current($match,$html = ' class="active"')
{
   $ci = & get_instance
   if($ci->uri->uri_string() == $match) // or ruri_string()
   {
      echo $html;
   }
}
The controller will not need to pass any value, The view would be
Code:
<ul>
  <li><a href="page"&lt;?php set_current('/controller/page'); ?&gt;></li>
  <li><a href="page2"&lt;?php set_current('/controller/page2'); ?&gt;></li>
  <li><a href="page3"&lt;?php set_current('/controller/page3'); ?&gt;></li>
</ul>
[/code]


Messages In This Thread
New to CI, have some questions - by El Forum - 02-26-2008, 05:20 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:14 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:24 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:35 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:37 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:40 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:43 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:47 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:48 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:50 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:54 AM
New to CI, have some questions - by El Forum - 02-26-2008, 06:55 AM
New to CI, have some questions - by El Forum - 02-26-2008, 07:10 AM
New to CI, have some questions - by El Forum - 02-26-2008, 07:28 AM
New to CI, have some questions - by El Forum - 02-26-2008, 07:30 AM
New to CI, have some questions - by El Forum - 10-26-2008, 11:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB