Is it necessary to use private functions in models? Is it necessary to use private functions in models? codeigniter codeigniter

Is it necessary to use private functions in models?


No, that is not necessary. It's an unusual situation for a user to have access to a class method through URL, and it's only implemented in codeigniter for controllers.


It's not necessary, and in fact prefixing private objects with "_" is depreciated with the actual use of the "private" and "protected" keywords in PHP 5+.


No its not necessary. To prevent access to the method from the browser, just add an underscore before the method: _method() . This is Ideal if you want to use/call it as a module(HMVC).