adamnet's avatar

Create a function to be called by every other function i a controller

In my application, I want to create a function that will contain some basic tasks to be executed before presenting data in the app views. I.e. I want every view at its top to have the name of the company which will be no static but will be fetched dynamically from the database. Obviously I do not want to repeat this query analytically in every method in the controllers. I want to call this class, obect or whatever by its name when I need it. Which way can I do it?

0 likes
4 replies
adamnet's avatar

In this case, do i still have to carry these data from the controller to the view through compact?

Please or to participate in this conversation.