Welcome Guest, Not a member yet? Register   Sign In
Calling the View from Function Index
#1

[eluser]crispinatari[/eluser]
index.php
Code:
<DIV ID="side_menu">
      &lt;?php $this->load->view('Main/menu');?&gt;
</DIV>
<DIV ID="main_content">
      &lt;?php $this->load->view('empslistview.php');?&gt;
</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(


Messages In This Thread
Calling the View from Function Index - by El Forum - 06-12-2009, 07:31 AM
Calling the View from Function Index - by El Forum - 06-12-2009, 07:34 AM
Calling the View from Function Index - by El Forum - 06-12-2009, 07:35 AM
Calling the View from Function Index - by El Forum - 06-12-2009, 07:37 AM
Calling the View from Function Index - by El Forum - 06-12-2009, 07:39 AM
Calling the View from Function Index - by El Forum - 06-12-2009, 09:19 AM
Calling the View from Function Index - by El Forum - 06-12-2009, 09:20 AM
Calling the View from Function Index - by El Forum - 06-12-2009, 09:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB