accessing base class variable |
[eluser]toopay[/eluser]
Unless you put/define/set that variable in constructor or call related function which contain some statement that set the variable value, theres no way you can get any value. You may want to take a look at Classes and Objects before starting play with those stuff.
[eluser]mehwish[/eluser]
Actually form_controller is my default controller so whenever i call it , the controller index function will automatically be executed and fetch form values which a user will put which are user email and password (email1 is one of the variable which will hold the user form information) and obviously these variables I cannot place in class constructure otherwise how user information will be assigned to these two variables which i want to set ... hope you get my point what i am trying to ask .. plz suggest any idea if not the way which i am using i.e., globally set variables
[eluser]InsiteFX[/eluser]
If you want them global then you need to define them in your MY_Controller not your Form_Controller! Anything you define in the MY_Controller will be global to all Controllers extended form the MY_Controller. InsiteFX
[eluser]mehwish[/eluser]
but I cannot define variable in parent class MY_controller because the variables I want to make global are getting values in child class Form_controller. so one thing i can do is once the variable got value in child class method, tell me how can i pass this variable to parent class?
[eluser]mehwish[/eluser]
Another problem is: as toopay said I have set a variable in constructor but again the same problem that is from one function this variable is being accessed but if I try to access the same variable from any other method of the same class I got nothing ... I don't know why it's happening ![]() Code: $this->variable.name |
Welcome Guest, Not a member yet? Register Sign In |