Shouldn't $this->load->library('foo') return TRUE if loaded? |
[eluser]stormbytes[/eluser]
Baffling. I'm loading a library in an if/elseif block, within a form validation callback function, like so: Code: ... I'm debugging it with Netbeans/Xdebug and I *see* the library loading/executing its constructor successfully. But for some reason, it's not returning TRUE?? Huh??
[eluser]Phil Sturgeon[/eluser]
The loader returns nothing, it assigns it to $this->resource. And CONSTRUCTORS ONLY TAKE ARRAYS. We've been through this all before
[eluser]stormbytes[/eluser]
Yes yes I'm aware. I re-wrote the constructor to take an array. If the constructor 'returns FALSE' then shouldn't the load call fail? EDIT: Just read your reply in the other thread. Thanks for shedding some light. Whats your advice Phil? How would I best go about accomplishing what I'm trying to do here? I need to know if the constructor succeeds or fails, based on the param that I'm passing to it.
[eluser]Phil Sturgeon[/eluser]
Nope. Everything is in here dude: http://ellislab.com/codeigniter/user-gui...aries.html You just load a library, assign it to the super-instance ($this) then call it. That is it.
[eluser]stormbytes[/eluser]
Damn.. a part of the UG that I actually haven't read! Hah Thanks Phil - I'll refactor.... ughhhhhh
[eluser]Phil Sturgeon[/eluser]
Code: $this->load->library('resource', array('url' => $resource_url)); or sod the constructors: Code: $this->load->library('resource'); |
Welcome Guest, Not a member yet? Register Sign In |