Welcome Guest, Not a member yet? Register   Sign In
Execute controller from view
#22

[eluser]nuwanda[/eluser]
Am I misreading this thread?

A controller is designed to pull data from a model and send it to a view. The reason a controller exists at all is to respond to a url. The url calls an action, a job to be done.

If the action is to display a dashboard of user data, then the controller pulls the user data from a model and sends it to a view where it is displayed. There's no need to call the model from the view, in fact, that defeats the controller's purpose.

The question of which user's data to display is answered by the controller. The url (which calls the controller/function) will specify the user name, id, etc. to be displayed. The controller will then pull the user data from the model and pass it to the view.

Now, granted, if you want a dynamic dashboard view, you need to use ajax. But the ajax calls are nothing more than background url calls which still need to be processed by the controller, that is, without a page refresh.


Messages In This Thread
Execute controller from view - by El Forum - 11-01-2007, 03:23 AM
Execute controller from view - by El Forum - 11-01-2007, 04:12 AM
Execute controller from view - by El Forum - 11-01-2007, 04:48 AM
Execute controller from view - by El Forum - 11-01-2007, 05:07 AM
Execute controller from view - by El Forum - 11-01-2007, 05:17 AM
Execute controller from view - by El Forum - 11-01-2007, 05:34 AM
Execute controller from view - by El Forum - 11-01-2007, 06:01 AM
Execute controller from view - by El Forum - 11-01-2007, 07:37 AM
Execute controller from view - by El Forum - 11-01-2007, 09:19 AM
Execute controller from view - by El Forum - 11-01-2007, 10:14 AM
Execute controller from view - by El Forum - 11-01-2007, 04:25 PM
Execute controller from view - by El Forum - 11-01-2007, 04:47 PM
Execute controller from view - by El Forum - 11-02-2007, 08:20 AM
Execute controller from view - by El Forum - 11-02-2007, 11:17 AM
Execute controller from view - by El Forum - 11-02-2007, 02:38 PM
Execute controller from view - by El Forum - 07-07-2009, 10:33 AM
Execute controller from view - by El Forum - 07-07-2009, 12:26 PM
Execute controller from view - by El Forum - 02-17-2010, 07:29 AM
Execute controller from view - by El Forum - 07-27-2011, 06:35 AM
Execute controller from view - by El Forum - 07-27-2011, 08:07 AM
Execute controller from view - by El Forum - 07-27-2011, 08:37 AM
Execute controller from view - by El Forum - 08-03-2011, 02:20 AM
Execute controller from view - by El Forum - 08-06-2011, 03:04 AM
Execute controller from view - by El Forum - 08-06-2011, 05:24 PM
Execute controller from view - by El Forum - 08-08-2011, 04:09 AM
Execute controller from view - by El Forum - 08-09-2011, 02:59 AM
Execute controller from view - by El Forum - 07-18-2012, 06:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB