I'm trying to write my own MY_Model base class but I'm facing a weird problem:
/core/MY_Model.php
function __construct() { if ( !empty($this->table)) { // query db, etc. } else { // even though that I set $this->table value // in the child class, I always ended up here // it's always empty!!!! log_message('error', 'some error message'); } // ... } } /models/test_model.php
function __construct() { parent::__construct(); } // ... } even though that I set $this->table value in the child class, I always ended up finding $table value empty in MY_Model class, it's always empty!!!! any hint please?!
$table, right? I'm asking just to make clear if I understand your question well.$tableproperty in child class will do that. But it's not updating parent class $table property. If do avar_dump()in parent constructor $table property is still empty. thank u.