The general rule is when to use the model (Codeigniter)

I was just curious what a rule of thumb was for models. As a rule, I use them only in situations where I need to add / edit or update database records for an object.

However, I am creating the application at that moment, which has a "config" table, which contains various data, such as the last update, which will control when certain functions will be displayed in the application. In this case, I will most of all have to retrieve data from the config table. Should I use these configuration methods in the model?

I am interested to know how more experienced coders approach the MVC methodology in pseudo-random CI examples (for example, which methods apply to the same object that you would use in the model and controller) would be most useful.

+3
source share
2 answers

"Should I use these configuration methods in the model?"

, , , , . ( MY_Model) , , .

, , .

, , , . xml ini , , . , , .

, , MVC, . CodeIgniter , , , config_item().

+7

M V & C , CSS HTML, .

, MVC . , ( CI) , .

+1

Source: https://habr.com/ru/post/1741871/


All Articles