• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.