CI = & get_instance(); $this->log_dir = lcfirst(get_class($this)); } function __get($name){ if('_model' === substr($name, -6)){ return $this->CI->$name; } elseif('_service' === substr($name, -8)){ return $this->CI->$name; } elseif('load' == $name){ return $this->CI->load; } elseif('config' == $name){ return $this->CI->config; } elseif(isset($this->CI->$name)){ return $this->CI->$name; } return null; } }