Hello, I am developing a sales system using the CodeIgniter 4 framework and I ran into a problem, I need to make the menu build dynamically
reading from a table the options so far, everything is fine, but at the time of passing it to the view I notice that I must do it from each controller as follows:
return view ('home / index.php', $ options);
But I want to avoid having to do that every time I call the view, that is, is there a way to do the load once in the view and display the menu on the rest of the screens?
I am working with templates so each view extends from a template where I include the different parts.
I thought about doing it using libraries but I didn't know how to load it from the parent template, or create a BaseController subclass and use this subclass and overload it with said functionality but I couldn't either.
I hope you understand what I need.
Thanks