родительский класс
class Main {
private $ci;
public function __construct()
{
$this ->ci=& get_instance();
$this ->ci->load->database();
}
}
дочерний класс
class Commonlib extends main {
public function __construct()
{
parent::__construct();
}
function getcountries(){
$this->db->from($this->countries);
$this->db->order_by("country", "ASC");
$query = $this->db->get();
return $query->result();
}
}
Я хочу получить доступ к родительской переменной конструктора в дочернем классе как дочернем классе. Я использую переменную базы данных
как получить доступ
i want to implement this code show this error
Fatal error: Class 'main' not found
Подробнее здесь: https://stackoverflow.com/questions/373 ... odeigniter