I am writing a CMS for my needs. It is built on MVC, there are main -> controller, model and view ( view ) them (controller model) inherit already index_controller , index_model and so on.
The question is as follows: on some pages, for example, www.web.com/static and say www.web.com/newslist , I need to display a list of news on the right.
Will it be correct to write a method that executes this sql query in the main model.php model (since this model is always loaded) and, if necessary, display a list, or do you need to write this method in the model of each individual controller ( static_model.php and newslis_model.php ) code duplication ?!