[eluser]Sytze Loor[/eluser]
I'm pretty new to CI, but until now I worked wonderful for me.
This morning, however, I've bumped into a little problem.
I have a controller with an index function that's getting some data from the database and calling a view after that.
In the view I try to create a table using the standard HTML Table class. But this gives a PHP error on: "Call to a member function set_heading() on a non-object in"
Here is part of the relevant source code:
Code:
// Controller:
function index() {
$users = $this->user->getUserList(); //$this->user is referring to the User model
$vdMain = array('users' => $users);
$this->load->view('front/users/list', $vdMain);
}
// View:
$this->table->set_heading(' ', 'Screenname', 'Registered at', 'Last login');
foreach($users as $user):
$this->table->add_row(' ');
$this->table->add_row($user['screenname']);
$this->table->add_row($user['created_datetime']);
$this->table->add_row($user['login_last']);
endforeach;
echo $this->table->generate();
Notes:
* I've added the table library to the autoload in config
* When I try to created a table using HTML it works
* I've placed my application folder in the root of the site (outside the system folder)
* I'm not really sure where to post this question, I'm sorry if I posted it wrong...
Thank you!
Sytze Loor