Error using Email Class |
[eluser]brandobandido[/eluser]
Hi CI Masters, I need your enlightenment here as I'm stumbled again to another CI issue that I can't seem to resolve since last night. Ok here's the situation. I created a method that's under the Functions library that uses the email class functionality. Below's my code. Code: /** And in my controller, I called it this way Code: $send_email_array = array( The Functions library was already auto loaded but when I execute it I get this error Code: Fatal error: Call to a member function from() on a non-object in /path/site/system/applications/backend/libraries/Functions.php on line 160 I really don't understand why $CI =& get_instance() is not anymore an object. Your help would be greatly appreciated as always! Regards
[eluser]Atharva[/eluser]
It seems you are not loading the email library. Are you auto loading it?
[eluser]brandobandido[/eluser]
[quote author="Atharva" date="1302962204"]It seems you are not loading the email library. Are you auto loading it?[/quote] Yes I am auto loading it Atharva.
[eluser]InsiteFX[/eluser]
If you are using a Library then you should intialize the CI Super global object like this! Code: class Library_name { InsiteFX
[eluser]brandobandido[/eluser]
[quote author="InsiteFX" date="1302983354"]If you are using a Library then you should intialize the CI Super global object like this! Code: class Library_name { InsiteFX[/quote] Hi! Thanks! I will try your suggestion ;-)
[eluser]brandobandido[/eluser]
[quote author="InsiteFX" date="1302983354"]If you are using a Library then you should intialize the CI Super global object like this! Code: class Library_name { InsiteFX[/quote] Hi InsiteFX, I tried it but still I get the same error. This is really damn because my code worked on some of my controllers.
[eluser]InsiteFX[/eluser]
As Atharva, mentioned above make sure that you are loading the Email Class Library! Code: class Library_name { InsiteFX
[eluser]brandobandido[/eluser]
[quote author="InsiteFX" date="1302993939"]As Atharva, mentioned above make sure that you are loading the Email Class Library! Code: class Library_name { InsiteFX[/quote] I already auto loaded the library as you can see here! Code: $autoload['libraries'] = array('template', 'database', 'session', 'email', 'functions', 'form_validation', 'site_settings', 'pagination', 'table', 'texts');
[eluser]InsiteFX[/eluser]
For one you should have your send email in a library not a function! Code: // You do not need to assign array here! InsiteFX
[eluser]Liu Guoqing[/eluser]
Can I help you!! More Info: CodeIgniter Dojo Helper SatSun Studio China |
Welcome Guest, Not a member yet? Register Sign In |