Creating a Library |
[eluser]Karlos23[/eluser]
I am currently creating a library (Login_Auth) and I have hit a brick wall. I keep getting the same old error each time! Quote:A PHP Error was encounteredI don't see where I have gone wrong though, my code is currently and yes I have got the instance CI loaded via my __construct() function. Code: public function __construct() Now the function. Code: public function forgot_pass($user_email) Any help? Thanks
[eluser]Jelmer[/eluser]
Code: $this->CI->email->from($email['name'], $email['address']); Code: $this->CI->load->library('email'); Also testing for a loaded config in this way is kinda useless as it will result in an error and the test will be of no use. If you want to test it you have to use it like this (read the User Guide if you don't know why): Code: if (!$this->CI->config->load('email', FALSE, TRUE))
[eluser]Karlos23[/eluser]
Seems I have ran into another problem, apparently it cannot load the database library but it hasn't been moved! I can autoload it without a problem but it won't let me load it through my library? My __construct() function where I load it is: Code: public function __construct()
[eluser]Jelmer[/eluser]
What kind of error are you getting? At a glance there's nothing wrong with the code but I (nor anybody for that matter) can't help you if you don't post your error with the code.
[eluser]Karlos23[/eluser]
As I basically said, it is just saying it cannot load the database... Quote:An Error Was Encountered
[eluser]Jelmer[/eluser]
The problem is that the database isn't loaded like a library when loaded from the controller instead of the autoloader. Check the user guide on how to: http://ellislab.com/codeigniter/user-gui...cting.html
[eluser]Karlos23[/eluser]
Ahh I see now, no wonder I didn't work. Thanks again for the help Jelmer! |
Welcome Guest, Not a member yet? Register Sign In |