Welcome Guest, Not a member yet? Register   Sign In
Can I extend a CI Library in a Package?
#3

[eluser]Drew J[/eluser]
Ok, I found that changing the file and class name to "Encrypt" instead of "MY_Encrypt" in my package causes it to be used. (Which makes me think it needs to be changed so that a "MY_X.php" file works from a package)

However, using your suggestion, I still get a method not found error when calling "$this->encrypt->new_function()" - (Call to undefined method CI_Encrypt::new_function())

Here's my extended file (Encrypt.php in my shared package). I can confirm this file is being called (inserting an "echo" in this file before the class declaration works).
Code:
require BASEPATH.'libraries/Encrypt.php';

class Encrypt extends CI_Encrypt {
    
    public function __construct()
    {
        parent::__construct();
    }
    
    public function new_function($string = NULL)
    {
        echo 'test';
    }
    
}

I'm pretty stumped... but it's also late. Maybe I just need to sleep on it?


Messages In This Thread
Can I extend a CI Library in a Package? - by El Forum - 04-16-2011, 01:21 AM
Can I extend a CI Library in a Package? - by El Forum - 04-16-2011, 01:49 AM
Can I extend a CI Library in a Package? - by El Forum - 04-16-2011, 02:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB