Welcome Guest, Not a member yet? Register   Sign In
accessing base class variable
#2

[eluser]Armchair Samurai[/eluser]
You need to define your variables with the correct scope:

Code:
class MY_Controller extends CI_Controller {

    var $user_name = 'base class variable successfully accessed';

    //Other MY_Controller stuff....

}

Also, if you're using the 2.x branch, you'll need to put MY_Controller in the Core folder, not the Library.


Messages In This Thread
accessing base class variable - by El Forum - 06-06-2011, 01:59 AM
accessing base class variable - by El Forum - 06-06-2011, 02:36 AM
accessing base class variable - by El Forum - 06-06-2011, 06:31 AM
accessing base class variable - by El Forum - 06-06-2011, 02:23 PM
accessing base class variable - by El Forum - 06-07-2011, 12:05 PM
accessing base class variable - by El Forum - 06-07-2011, 02:35 PM
accessing base class variable - by El Forum - 06-08-2011, 03:12 AM
accessing base class variable - by El Forum - 06-08-2011, 03:57 AM
accessing base class variable - by El Forum - 06-08-2011, 04:19 AM
accessing base class variable - by El Forum - 06-08-2011, 04:31 AM
accessing base class variable - by El Forum - 06-08-2011, 05:14 AM
accessing base class variable - by El Forum - 06-08-2011, 07:33 AM
accessing base class variable - by El Forum - 06-08-2011, 11:43 PM
accessing base class variable - by El Forum - 06-09-2011, 12:54 AM
accessing base class variable - by El Forum - 06-09-2011, 05:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB