06-12-2009, 07:31 AM
[eluser]crispinatari[/eluser]
index.php
emps controller
this produces error:
"Fatal error: Using $this when not in object context in W:\www\CI1\index.php on line 5"
am i calling the view incorrectly in the index page? :0(
index.php
Code:
<DIV ID="side_menu">
<?php $this->load->view('Main/menu');?>
</DIV>
<DIV ID="main_content">
<?php $this->load->view('empslistview.php');?>
</DIV>
emps controller
Code:
function index()
{
//default method, gets data from model
//and lists all employees using default view
$data['title'] = "Employee application";
$data['heading'] = "Employee List";
/// LOADING PARTIALS //
$data ['header'] = $this->load->view('views/header', $data, TRUE);
$data ['menu'] = $this->load->view('views/menu', $data, TRUE);
$data ['footer'] = $this->load->view('views/footer', $data, TRUE);
$data['res']=$this->empsmodel->get_all_emps();
$this->load->view('empslistview', $data);
}
this produces error:
"Fatal error: Using $this when not in object context in W:\www\CI1\index.php on line 5"
am i calling the view incorrectly in the index page? :0(