Welcome Guest, Not a member yet? Register   Sign In
CI instance in external class
#1

[eluser]Flynn[/eluser]
Hi guys, is it possible to load CodeIgniter object (get_instance() in libraries/helpers) in external php class.
For some reasons, i can't make library/helper out of one php class, but i need some variables from Framework in this class (no, i can't send variables there - this class is loaded before CI).

Thanks.
#2

[eluser]Buso[/eluser]
try this:
Code:
ob_start();
include('index.php');
ob_end_clean();
$CI =& get_instance();
#3

[eluser]Flynn[/eluser]
Thanks a lot, Buso. That code works, unfortunately, i decided to rework class to integrate it with CI without includes. Anyway, i hope some people will find it helpful.
Thanks again.




Theme © iAndrew 2016 - Forum software by © MyBB