Welcome Guest, Not a member yet? Register   Sign In
Creating a menu
#4

[eluser]louisl[/eluser]
Pretty much what Philo01 said, but I use a little helper function then use it all over the place, I got a bunch of other useful funcs in there too.
Code:
<li&lt;?php echo class_selected($this->uri->segment(1), 'menu-item'); ?&gt;>Menu item</li>

&lt;?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

function class_selected($str1, $str2) {

if ($str1 == $str2) {

  return ' class="selected" ';
  
}

}

/* End of file MY_text_helper.php */
/* Location: ./application/helpers/MY_text_helper.php */


Messages In This Thread
Creating a menu - by El Forum - 02-03-2012, 06:27 AM
Creating a menu - by El Forum - 02-03-2012, 06:39 AM
Creating a menu - by El Forum - 02-03-2012, 09:38 AM
Creating a menu - by El Forum - 02-03-2012, 11:09 AM
Creating a menu - by El Forum - 02-03-2012, 04:26 PM
Creating a menu - by El Forum - 02-05-2012, 02:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB