Welcome Guest, Not a member yet? Register   Sign In
How do you handle controllers for pages that are either static or do not fit the object paradigm?
#1

[eluser]jleequeen[/eluser]
Hello everyone,

I've been wondering about how to handle certain pages of my app. In particular those pages that are either static, or that don't really fit nice and neat within the objects or resources of your app.

For example, the homepage of your app? Do you create a home controller (keeping in mind that this page might need access to different models like news, comments, posts) or do you put a home (or index) function in a page controller and do it that way. I've always been a little weary of a "page" controller because it doesn't really seem to fit. But then again, building a controller for every static page doesn't necessarily seem right either.

Another thing I wonder, is do we sometimes use controllers as just namespaces instead of them actually needing to be a controller? Seems kinda inefficient to have something like a page controller that you keep adding pages to, and not needing but one function out of all those that are in the controller.

I understand very well, that when you sit down to design your application, that some objects or resources jump out at you, and they make perfect sense. Like a user for instance. Obviously you would need a user/login, user/logout, user/add, user/edit, etc. or perhaps you have a news page, and you would need news/add, news/edit, news/delete, etc. Those are easy to understand. It's the pages that don't fit into those neat examples that trouble me.

So for me, things like static pages, a home page, or even say you have a dashboard view for each different type user in your system. Would that mean you would need one dashboard controller with a method for each type of user, or for each type of user you would have a separate dashboard method?

Can anyone help me out with these pages that don't fit nicely into the object paradigm.


Messages In This Thread
How do you handle controllers for pages that are either static or do not fit the object paradigm? - by El Forum - 08-12-2009, 10:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB