Controller can have private methods?

2

I have a question and wanted to hear more people's opinions. Following the MVC , can a Controller have private methods? This question came to me because in my context, I have a Controller JS , and my View is an HTML page. Well, if Controller exists to control View , it does not make much sense for it to have private methods, since View or does it make sense yes ?! Maybe I'm getting confused a bit.

    
asked by anonymous 26.05.2017 / 18:48

1 answer

2

Sometimes we want methods that can only be accessed by the controller itself, such as calculations, state changes, and more. This way, the view will not have direct access to these methods, just from other methods.

    
26.05.2017 / 19:27