06-07-2015, 08:31 AM
Hi!
I have a problem, I want set 'active' class to navbar on current page. I tried to something like this but it doesn't work:
I have all pages in one controller:
How can I do this?
I have a problem, I want set 'active' class to navbar on current page. I tried to something like this but it doesn't work:
PHP Code:
<?=($this->uri->segment(1)==='main/index')?'active':''?>
I have all pages in one controller:
PHP Code:
class Main extends CI_Controller {
function __construct() {
parent::__construct();
}
public function index() {
$data['title'] = 'Aktualności';
$this->load->view('templates/web/header', $data);
$this->load->view('vrs-pages/index');
$this->load->view('templates/web/footer');
}
public function page_InformacjeTurniej() {
$data['title'] = 'O turnieju';
$this->load->view('templates/web/header', $data);
$this->load->view('vrs-pages/informacje/o-turnieju');
$this->load->view('templates/web/footer');
}
public function page_InformacjeNagrody() {
$data['title'] = 'Nagrody';
$this->load->view('templates/web/header', $data);
$this->load->view('vrs-pages/informacje/nagrody');
$this->load->view('templates/web/footer');
}
// ETC ...
}
How can I do this?