Fatal error: Call to a member function set_template() on a non-object - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Fatal error: Call to a member function set_template() on a non-object (/showthread.php?tid=25503) |
Fatal error: Call to a member function set_template() on a non-object - El Forum - 12-14-2009 [eluser]skylerrichter[/eluser] I have a weird issue occurring with the HTML table class when I extends models. I found one other thread with a similar issue but it doesn't seem to be the same issue all together http://ellislab.com/forums/viewthread/78244/ The dashboard controller extends the private controller which is just an extension of the default controller with some user authentication. I load the comments model. Get a result set of comments. and load a view file. here is what my view file looks like: Code: <?php $this->table->set_template(array('table_open' => '<table border="0" cellpadding="0" cellspacing="0" width="100%">', 'row_alt_start' => '<tr class="alt">')); ?> here is what my controller looks like: Code: class Dashboard extends Private_Controller If I remove this line from my view Code: <?php $this->table->set_template(array('table_open' => '<table border="0" cellpadding="0" cellspacing="0" width="100%">', 'row_alt_start' => '<tr class="alt">')); ?> everything works... including the codeigniter pagination class that is in the same view. How come the HTML table class stops working but the pagination class doesnt? Note: both the table class and pagination classes are loaded in the autoload config Fatal error: Call to a member function set_template() on a non-object - El Forum - 12-14-2009 [eluser]pistolPete[/eluser] Did you load the library? Code: $this->load->library('table'); Fatal error: Call to a member function set_template() on a non-object - El Forum - 12-14-2009 [eluser]skylerrichter[/eluser] Yes i tried loading the libraries manually too. |