php - Initializing Codeigniter Utilities inside contstructor on Custom Class -
i have been doing ci few months , got point wanted create own library class on ci. now, problem can't seem instance of ci in order me utilize native resources. i've done this.
class myclass{ protected $instance; public function __construct() { $this->$instance = &get_instance(); <-- did (theoretically speaking) } }
other things i've tried
class myclass{ protected $instance = &get_instance(); <-- reports syntax error on apatana public function __construct() { } }
anyone of out there can give me better idea on how instance (initializing 1 point on source code) <-- being said that, wanted instance once , use on over class
you can use in way in constructor $this->ci = & get_instance(); can use $this->ci->load->model();
Comments
Post a Comment