autoload not working correctly - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: autoload not working correctly (/showthread.php?tid=63133) |
autoload not working correctly - mcgiwer - 09-29-2015 Welcome. I think I had found a bug in autoload. In the configuration I had added to autoload all needed libs (like by example "html", "url" with I needed). After I wrote the code, I recieved error about call to unknown functions (with I got from the documentation for the html and url helpers). I solved it by typing on the code top: Code: $this->load->helper('html'); This would mean that the autoloader don't work because before I entered the above code, the libs weren't automacially loaded as they should be. RE: autoload not working correctly - Muzikant - 09-30-2015 Thank you for your report. I tested it and autoload works for me. Try to test it for yourself with clean installation of the latest version of CodeIgniter. It should work fine. RE: autoload not working correctly - Narf - 09-30-2015 As evident by your $this->load->helper() calls, 'url' and 'html' are helpers and not libraries ... you can't load them as "libraries". RE: autoload not working correctly - joseph.dicdican - 10-27-2015 (09-29-2015, 11:35 AM)mcgiwer Wrote: Welcome. I think I had found a bug in autoload. In the configuration I had added to autoload all needed libs (like by example "html", "url" with I needed). Hi, I would just like to clarify where did you put the codes (e.g. $this->load->helper('html') ...). You have mentioned, In the configuration I had added to autoload all needed libs (like by example "html", "url" with I needed). I assumed you are writing the loading codes to some other file not controller nor model. If that's the case, you cannot really call $this->load->helper since $this is not referenced to any object specifically to CI singleton instance. (e.g. $CI =& get_instance()) Please consider the link for more info. http://tosbourn.com/codeigniter-use-get_instance/ You can find these statements below. Quote:If however you are writing your own custom libraries or something that sits outside of the MVC files then you do need to use it. I hope these have sense. Thank you. - joseph.dicdican |