I want to use methods for questions and comments like add_question(), get_all_quests(), add_comment() etc. in just one model. Why, you might ask, because I have one function there validate_html(), which validates html code and I want to validate it in both comments and questions (because people can enter html code in comments and questions). So, is it ok to do like that?
I want to use methods for questions and comments like add_question(), get_all_quests(), add_comment() etc.
Share
The function validate_html() should go into separate system of library. So along with MVC there should be a fourth level called Library which can be shared across the application
Please refer my answer here: Proper place to put logic in MVC for more info.