class MY_Controller extends CI_Controller
{
public $username;
function __construct()
{
parent::__construct();
$this->username = "User";
}
}
class Post extends MY_Controller
{
public function index()
{
$data = array(
'name'=>'CodeIgniter',
'username' => $username
);
$this->template->load('post/index', $data);
}
}
I don't access to $username in Post class, how to fix this problem?