When using MVC, which controller should Terms of Service, Privacy, Help, About actions belong to? Should I put them all in IndexController or should each one of them be put in their own controller?
When using MVC, which controller should Terms of Service, Privacy, Help, About actions belong
Share
Hmm … no language mentioned. Only name of
indexControllerindicates, that you are talking about web based application. Also i will assume that you are using Model2 MVC pattern.Ok, the short answer: it depends.
Let’s assume this an extremely simple case .. , because it depends on :
Your application should already have a controller, which is responsible for interaction with documents (for things like opened articles). In this controller you add a method, which reads the name of page from request object, and tell Model Layer: “I will need this”.
In the View instance, you request from model layer the content of opened document (which is your prepared “About” or “Rules” text). Bind it to standard template and render it.