Welcome Guest, Not a member yet? Register   Sign In
I'm at a standstill....need help with controllers (theory)
#7

[eluser]jleequeen[/eluser]
@Rick Jolly

Yeah, I realize that. I appreciate your insight and I'm really leaning the way of one controller per view for the reasons that you suggested, better organization and less code to load.

@Colin Williams

I totally understand your examples and realize what your saying. My problem with thinking of controllers as object handlers begins to break down when I think about the "cart" controller example you used. I realize how large a checkout method in the cart controller might be as it should be. Like you said, it does a lot of stuff. But, to me, it would be better to actually have a "checkout" controller, because it just seems a waste to have all those other methods in the cart controller that have to get loaded that won't be used on that request. It would seem that the only things that could be shared between the different methods in a cart controller would be possibly a cart_model and maybe a couple libraries, but other than that, all the methods would probably stand on their own.

@anyone

It seems that sometimes the controller can be abused and used strictly for grouping somewhat related functions. Maybe in my one controller per view thinking, I should look at putting controllers into subfolders as my way of grouping related functions, instead of throwing everything in one controller file.


Messages In This Thread
I'm at a standstill....need help with controllers (theory) - by El Forum - 08-30-2008, 09:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB