Calendar class problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forumdisplay.php?fid=18) +--- Thread: Calendar class problem (/showthread.php?tid=363) |
Calendar class problem - trip3nd - 11-25-2014 Hi everyone, Im working with codeigniter for a while and can fix most problems myself. Now I stubled on a problem where I am not sure what the problem really is. I am trying to load the calendar class to generate a calendar. I auto-loaded the class, loaded in the controller's construction method, and tried to load it in the controllers method where I use it. Nothing seems to work because I get this error everytime: Call to undefined method Calendar::generate() When I check if the calendar class is loaded it returns a false... I have no idea what the problem is. I did not alter any codeigniter system functions and the class is in the normal directory. Did anyone had this problem before or understands whats going on here? RE: Calendar class problem - Rufnex - 11-25-2014 Hm, normaly it should work like this: PHP Code: $this->load->library('calendar'); Is this what you did? RE: Calendar class problem - trip3nd - 11-25-2014 yes, I used the example code from the CodeIgniter User Guide Version 2.2.0. I am running this version. This is the first time I tried the calendar class, but it doesnt work with the example code. I am running it local on WAMP. The exact error is: ( ! ) Fatal error: Call to undefined method Calendar::generate() in C:\wamp\www\XXX\application\controllers\admin.php on line 104 Call Stack # Time Memory Function Location 1 0.0014 258408 {main}( ) ..\index.php:0 2 0.0038 316416 require_once( 'C:\wamp\www\XXX\system\core\CodeIgniter.php' ) ..\index.php:202 3 0.1362 3380352 call_user_func_array:{C:\wamp\www\XXX\system\core\CodeIgniter.php:359} ( ) ..\CodeIgniter.php:359 4 0.1362 3380480 Admin->bla( ) RE: Calendar class problem - sv3tli0 - 11-25-2014 trip3nd please provide us with your code.. we can't just guess what is the problem.. RE: Calendar class problem - trip3nd - 11-25-2014 I thought I explained clear enough... Well I am using the exact same code as the userguide example: $this->load->library('calendar'); echo $this->calendar->generate(); And this does not seem to work. The library isnt loaded and because of that the error indicates that the calendar->generate method doesnt excist..... RE: Calendar class problem - sv3tli0 - 11-25-2014 (11-25-2014, 07:20 AM)trip3nd Wrote: I thought I explained clear enough... Do you have any model/library or other class loaded with the same name calendar ? Some times such name duplication can fuck you up.. You can var_dump($this->calendar) just to be sure that this is the required Library class. RE: Calendar class problem - Rufnex - 11-25-2014 Just for fun .. can you include the timezone in the /index.php of your document root like that (e.g. for germany) PHP Code: try one of them This is done in CI3. Maybe it helps you for your WAMP environment |