独自の MY_Model 基本クラスを作成しようとしていますが、奇妙な問題に直面しています:
/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();
}
// ...
}
子クラスで $this->table の値を設定したにもかかわらず、常に MY_Model クラスで $table の値が空であることがわかりました。常に空です!!!! 何かヒントをください?!