Skip to content

Instantly share code, notes, and snippets.

@hamstar
Created August 3, 2011 22:53
Show Gist options
  • Save hamstar/1124052 to your computer and use it in GitHub Desktop.
Save hamstar/1124052 to your computer and use it in GitHub Desktop.
Boilerplate structure for CI models
<?php
class MY_Factory extends CI_Model {
public static function create() {
}
public static function find( $id ) {
}
}
<?php
class MY_Model extends MY_Factory {
function __construct( $id ) {
self::find( $id );
}
public static function delete( $id ) {
}
public static function save() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment