I'm newbies to CodeIgniter and Grocery CRUD.
Thanks for GroceryCRUD's author, John Skoumbourdis.
This project make my life more easy and more relax
I wanna use set_model function which handle some work
set_model is used in my code (Controller's method):
$crud->set_model('My_model');
and then, created my_model.php file in application/model folder
class My_model extends grocery_CRUD_Model {
function list_all(){
$this->db->order_by('sn','desc');
return $this->db->get("table1");
}
}
But now, how can I use My_model's method list_all in Grocery CRUD code ?
Because I used the code:
$this->My_model->list_all();
Nothing happen
and used this code:
$crud = new grocery_CRUD();
$crud->My_model->list_all();
Show me error message:
Message: Undefined property: grocery_CRUD::$My_model
Today, I searched all day in this topic, but I can't found any about this topic
Thanks for anybody who can help me
And my English text is a little weak, please don't mind.