• Notice regarding image hosts and attachments. See here.

DELETED_23244

Really you should write get_data() and set_data($array) methods to be thorough but this should get you started.

Code:
class MY_Controller extends Controller {

private $data = array();

        //note __construct() rather than the class_name() which is deprecated

	function __construct()
	{	
		parent::Controller();
		$this->data = array('1' = > '1', '2' => '2', '3' => '3');
		//constructors cannot return $data;
		
	}

}

Code:
class Example extends MY_Controller
{
	function __construct()
	{
		parent::__construct();
	}

	function index()
	{

		print_r($this->data);
	
	}
}
 
Back
Top Bottom