CodeIgniter Forums
Calendar Not Loading Preferences [FIXED] - 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: Calendar Not Loading Preferences [FIXED] (/thread-30039.html)



Calendar Not Loading Preferences [FIXED] - El Forum - 04-30-2010

[eluser]wdcmatt[/eluser]
Wow... I was about to post about a problem I was having with the calendar but I figured it out. So to help other people avoid the same problem here is what I learned.

The calendar class only uses the preferences/config of the first instance of its being called.

For example. I called

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

In the constructor for my classes, I then (in a method of that class) initialized my preferences and attempted to re-load the calendar library with the new preferences

Code:
$this->load->library('calendar', $pref);

And it didn't work. Where my $pref is a keyed array as defined by the CI documentation. No matter what I changed my $pref's too... my output was locked to the default from CI.

So if you are having problems that no matter how much you change your $pref's your output doesn't change... make sure you have not already called the calendar class with different configs. Hope this saves someone the 40 min headache it caused me.