Skip to content

Instantly share code, notes, and snippets.

@andyhawthorne
Last active December 19, 2015 10:38
Show Gist options
  • Save andyhawthorne/5941500 to your computer and use it in GitHub Desktop.
Save andyhawthorne/5941500 to your computer and use it in GitHub Desktop.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function active($name, $number)
{
$ci = get_instance();
if($name == 'home' && $ci->uri->segment(2) == "" && $number == 1)
{
return "class='active'";
}
elseif($name=="about" && $ci->uri->segment(2) == "about" && $number == 2)
{
return "class='active'";
}
elseif($name=="story" && $number == 3)
{
return "class='active'";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment