Skip to content

Instantly share code, notes, and snippets.

@arunoda
Created June 21, 2012 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arunoda/649ab8636ea95314f505 to your computer and use it in GitHub Desktop.
Save arunoda/649ab8636ea95314f505 to your computer and use it in GitHub Desktop.
Codeigniter - Extend a library
<?php
class Hello extends MY_Controller {
public function index() {
$this->load->library('log');
//$this->log->write_log("INFO", "this is logging");
$this->log->info("this is logging");
}
}
<?php
class My_Log extends CI_Log {
public function info($message) {
parent::write_log("INFO", $message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment