Welcome Guest, Not a member yet? Register   Sign In
Extends CI native library into a package
#2

[eluser]manix[/eluser]
Well, I got and this is the final snipped:

1. Add the package
Code:
$this->add_package_path('/public_html/community/application/');

2. Load the Session library from Root CI application
Code:
$this->library('session');

3. Load the library from the application package (cmommunity)
The magic here is that this class extends from Session class previously loaded at point 2.
Code:
$this->library('MY_Session', '', 'csession'); //rename the session to avoid name conflicts


Now, in my root application controllers I can do:
Code:
$this->csession->custom_method();


Messages In This Thread
Extends CI native library into a package - by El Forum - 10-17-2012, 08:41 AM
Extends CI native library into a package - by El Forum - 10-17-2012, 09:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB