[eluser]mehwish[/eluser]
hi everyone. I am new to CI and stuck in a step. I have a base class named as MY_controller in application/library folder containing the following code:
Code:
<?php
class MY_controller extends Controller{
function MY_controller()
{
parent::controller();
}
function MY_controller_function()
{
$user_name='base class variable successfully accessed';
}
} //end of class
?>
and also another class Form_controller in application/controller containing the following code in which i am trying to echo the user_name variable but it is not working
Code:
class Form_Controller extends MY_Controller {
function Form_controller()
{
parent::Controller();
}
function my_profile_page($data2=null)
{ echo $this->user_name;}
} end of class
Plz help me out in solving this. I have searched alot and found the sam eway to echo the value i.e., using $this->user_name but it is showing nothing