⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Utility of models in GroceryCrud



alain

alain
  • profile picture
  • Member

Posted 04 July 2013 - 07:46 AM

Hi

 

It seems that the models are no longer useful with Grocery Crud. For example in image_crud, there is no use of codeigniter model!!

 

In when case, model will be useful? Because even if grocery crud, the file grocery_crud_model.php is not used!

 

Cordially,

 

Alain


davidoster

davidoster
  • profile picture
  • Member

Posted 04 July 2013 - 09:16 AM

Hello and welcome to the forums [member=Alain].

Well, I must tell you a big secret! Most of the times, if not all of the times, things are not the way they seem to be!!!
In a more serious way, the models are actually, used and without them the libaries won't work!

 

Let me explain a bit more.
For example, on the very first example, the simplest example, the creator says:
"Even if you are bored to write the set_table function , the library searchs if the function name exists as a table name"

This wouldn't be possible if the grocery_crud_model.php didn't exist!
And the story goes on and on..!
 


alain

alain
  • profile picture
  • Member

Posted 04 July 2013 - 09:59 AM

Ah okay, $crud = new grocery_CRUD() is calling this CI_Model!

 

In fact, this model is the key of this CRUD generator!