Documentation

Models


Models

Model are the classes that retrieve the data from your data store (usually the database). You can create your own model as follow:

class News_Model extends Model{
    function get_news_list(){
         $db = DB::get_instance();
         return $db->get_list("SELECT * FROM news");
   }
}

The model are saved into application/models/ directory, and named as News.php.

Remember that model always return a variable.