Sharing private function among different controllers
Hello,
what's the best way to share a private function among different controllers?
I have an area of my about Working Hours with partners: always, everyday (same hours for every day), custom. I have split the logic in 3 different controllers. However there are 3 private functions to be used in each controller.
The best way to handle your question is to create Service classes for your Controller classes, and use the private functions within the Service class in the Service classes public functions creating the business logic and then share the public functions that hold the private functions to be used in other Controller classes. That would be the best way to share private functions within the Controllers.