Welcome Guest, Not a member yet? Register   Sign In
undefined function get_instance() ?
#1

[eluser]Tom Vogt[/eluser]
Why does the get_instance() call in following code not work? It tells me "undefined function get_instance()" and I don't understand why:

Code:
class MY_Language extends CI_Language {

    public $ci;

    public function __construct() {
        parent::__construct();
        $this->ci =& get_instance();
    }
#2

[eluser]InsiteFX[/eluser]
Not sure if you posted all of your controller code?

But your class is missing the closing }

InsiteFX
#3

[eluser]Tom Vogt[/eluser]
I posted only the first part, of course there's additional code below this, including the closing bracket. :-)
#4

[eluser]gRoberts[/eluser]
It's most likely because parent::Controller() hasn't been called before your MY_Library file has been called.

I've had this problem when trying to use any CI related functions before calling it.
#5

[eluser]Cristian Gilè[/eluser]
http://ellislab.com/forums/viewthread/129747/#641022

Cristian Gilè




Theme © iAndrew 2016 - Forum software by © MyBB