I just wanted some advice regarding the MVC way of doing things. I am using codeigniter and I was wondering if it's better to have one controller per page for a website or to have one controller for all the pages?

Let's say I have a simple website where you can visit the homepage, login, create an account and contact the admin.

  1. Would it be better to have these controllers: frontend(index), login, account, contact OR having one controller called frontend or whatever with the actions such login, createAccount, contact?

  2. When do you know if its better to use one controller in a situation?

没有正确的解决方案

许可以下: CC-BY-SA归因
scroll top