Skip to content

Instantly share code, notes, and snippets.

@simensen
Created February 2, 2010 20:08
Show Gist options
  • Save simensen/292971 to your computer and use it in GitHub Desktop.
Save simensen/292971 to your computer and use it in GitHub Desktop.
<?php
class SomeModel extends Model {
function doSomething ($foo) {
// need to work with another model...
$CI =& get_instance();
$CI->load->model('SomeOtherModel','NiceName',true);
// use $CI instead of $this to query the other models. Shorter anyway ;-)
$CI->NiceName->doSomethingElse();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment