Welcome Guest, Not a member yet? Register   Sign In
Run another controller's method
#16

[eluser]John Fuller[/eluser]
I don't get it.

I have a model for the blog and another for comments (as well as more models for the admin versions of each.) All the controller does is make the calls to all the models needed, loads up the array and spews everything out into the view page. That is all the controller is, a middle man. The real action is going on in the models.

There might be a little bit of overlap between two controllers doing much the same stuff but why be so hardcore about not reusing code? For instance, I have a blog controller and an archive controller. The blog just shows entries and the number of comments. The archives controller shows a single entry, all the comments for that entry and a comment form. The two controllers are similar but not exactly the same.

So in Sam's example, why not do (in my uber pseudocode)

[call model(blog), call model(comments)] => controller => view => collect underpants => ? => profit!


Messages In This Thread
Run another controller's method - by El Forum - 02-13-2008, 03:50 AM
Run another controller's method - by El Forum - 02-13-2008, 06:01 AM
Run another controller's method - by El Forum - 02-13-2008, 07:00 AM
Run another controller's method - by El Forum - 02-13-2008, 07:03 AM
Run another controller's method - by El Forum - 02-13-2008, 10:50 AM
Run another controller's method - by El Forum - 02-13-2008, 11:02 AM
Run another controller's method - by El Forum - 02-13-2008, 10:18 PM
Run another controller's method - by El Forum - 02-13-2008, 11:23 PM
Run another controller's method - by El Forum - 02-15-2008, 11:34 AM
Run another controller's method - by El Forum - 02-15-2008, 11:51 AM
Run another controller's method - by El Forum - 02-15-2008, 02:53 PM
Run another controller's method - by El Forum - 02-15-2008, 03:01 PM
Run another controller's method - by El Forum - 02-15-2008, 06:42 PM
Run another controller's method - by El Forum - 02-15-2008, 08:30 PM
Run another controller's method - by El Forum - 02-15-2008, 08:34 PM
Run another controller's method - by El Forum - 02-15-2008, 10:24 PM
Run another controller's method - by El Forum - 02-16-2008, 06:44 AM
Run another controller's method - by El Forum - 05-19-2009, 09:49 AM
Run another controller's method - by El Forum - 05-19-2009, 10:14 AM
Run another controller's method - by El Forum - 05-19-2009, 07:28 PM
Run another controller's method - by El Forum - 05-20-2009, 02:09 AM
Run another controller's method - by El Forum - 05-20-2009, 02:10 AM
Run another controller's method - by El Forum - 05-20-2009, 02:35 AM
Run another controller's method - by El Forum - 05-20-2009, 09:19 AM
Run another controller's method - by El Forum - 07-03-2010, 06:51 PM
Run another controller's method - by El Forum - 07-04-2010, 08:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB