Common controler content

Discuss new feature ideas or ways to modify the existing features.
Post Reply
Posts: 8
Joined: 18 Oct 2017, 18:42

07 Dec 2017, 17:55

I found myself creating multiple modules for a project. Nothing unusual there, but they all share a common page header. I was hoping to read configuration data from a model and generate specific information dynamically but putting the data functions in the view file definitely is contrary to basic MVC patterns and there is nothing that allows for a common set of controller functions without defining a new controller base class and extending from there - which can lead to having to make an extended version of all the other controllers and other major rewrites to the base framework. I'm aware of the idea of view partials but that has other issues. My other choice is to have to embed the same darn code in every generated controller class. We have a model of common view templates but not one of common controller templates. Possibly just have Base_Controller look for something in the application of public folders. I'm just spitballing here as far as details. Trying to DRY as much as possible.

Post Reply