CodeIgniter Forums
Codeigniter + Doctrine = Message: Undefined property: CI_Loader::$table - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Codeigniter + Doctrine = Message: Undefined property: CI_Loader::$table (/thread-29653.html)



Codeigniter + Doctrine = Message: Undefined property: CI_Loader::$table - El Forum - 04-16-2010

[eluser]Unknown[/eluser]
Hi i am pretty new to both Codeigniter and Doctrine,

ever since i added Doctrine i cannot get the Html Table class to work i haven't been able to find any information on the the problem anywhere.

Code:
$this->load->library('table');

$data = array(
             array('Name', 'Color', 'Size'),
             array('Fred', 'Blue', 'Small'),
             array('Mary', 'Red', 'Large'),
             array('John', 'Green', 'Medium')    
             );

echo $this->table->generate($data);

results in this error message

A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI_Loader::$table

Filename: views/welcome_message.php

Line Number: 58


Fatal error: Call to a member function generate() on a non-object in C:\xampp\htdocs\CHIP\system\application\views\welcome_message.php on line 58

thanks for any help you can provide


Codeigniter + Doctrine = Message: Undefined property: CI_Loader::$table - El Forum - 05-12-2010

[eluser]canicasio[/eluser]
I think you have to load the table class.

Go to system/application/config/autoload.php

Set table at $autoload['libraries'] = array();

Like this: $autoload['libraries'] = array('table');


Codeigniter + Doctrine = Message: Undefined property: CI_Loader::$table - El Forum - 05-12-2010

[eluser]Zack Kitzmiller[/eluser]
Don't load libraries in the view. Load them in the controller. Then it will be available in the view. You don't need to autoload it if you don't want to.


Codeigniter + Doctrine = Message: Undefined property: CI_Loader::$table - El Forum - 05-12-2010

[eluser]canicasio[/eluser]
Im new in CI. Thanks for the clue.


Codeigniter + Doctrine = Message: Undefined property: CI_Loader::$table - El Forum - 11-16-2010

[eluser]asciiCode[/eluser]
If you load a library in the controller how do you access in the view?

For example you can't use $this->LibraryName->FunctionName() in the view. What would you use?


Codeigniter + Doctrine = Message: Undefined property: CI_Loader::$table - El Forum - 11-16-2010

[eluser]danmontgomery[/eluser]
Code:
$CI =& get_instance();
$CI->libraryname->function();



Codeigniter + Doctrine = Message: Undefined property: CI_Loader::$table - El Forum - 06-13-2011

[eluser]brookerrj[/eluser]
I had the same problem. The only way I could get it to work was by autoloading. Trying to use the library by loading it in the controller gave me the same problem that this thread's author experienced.