[eluser]mikeziri[/eluser]
i have a big problem and i think it is a framework bad design. here is an example:
i have this model under models/
Code:
class User extends Model {
function User() {
parent::Model();
}
//some class methods
// class static methods
public static function find_by_id($id) {
$this->db->query("select * from users where id = '{$id}'");
// etc...
// maybe make a new User() to return
}
}
as you may have caught, you can't do $this->db... in a static method as it will say that $this is not an object and therefore, can't be used on a non instantiated class.
so my question is, how can i access the db library without the ugly method:
$ci =& get_instance();
$ci->db->...
thank you