What do you call your main controller? |
(11-13-2015, 12:25 PM)DreamOfSleeping Wrote: Thanks again for replying. I admit already knew the first half of what you said. I think it's my fault for not making myself clear. It's a complicated topic though. Honestly, I would have a "Users" controller which contained methods to display the user's home page, profile, etc. Then I would have a "Home" controller (or whatever) to show the website home, and probably anything else I couldn't really put in a better location. In Home/index, if I wanted the user sent to their home page when they are logged in, I would just redirect to Users/home or whatever is appropriate. On the other hand, if you wanted more of a "single-page" design, or just wanted to use a limited number of controllers, you could use one "Home" (or whatever) controller, and have libraries/models retrieve the appropriate content based on the current user, or whatever other information is needed. In any case, you can use routes to map URIs to controllers/methods as needed, so you can choose to have one controller with a lot of methods, or a lot of controllers with a few methods. You could even run everything through one controller with one method (more or less, as long as the method is named index or _remap).
11-13-2015, 01:18 PM
(This post was last modified: 11-13-2015, 01:21 PM by DreamOfSleeping. Edit Reason: missed out a word ) (11-13-2015, 01:05 PM)mwhitney Wrote: Honestly, I would have a "Users" controller which contained methods to display the user's home page, profile, etc. Then I would have a "Home" controller (or whatever) to show the website home, and probably anything else I couldn't really put in a better location. Thanks for the reply. That does seem to be more of an organized way of doing it. I'll give that a try. |
Welcome Guest, Not a member yet? Register Sign In |