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

[eluser]gtech[/eluser]
If you are displaying static HTML you should work out all the data you want display in the controller (by calling multiple models) and then build up a list of variables to parse in the view. you can call other controllers (or the same controller with different params) by providing a link in a href or form for the user to click on.

If you are building dynamic pages that use javascript and need to update/retrieve data without calling a new URL (drag and drop might be an example) then I have used ajax succesfully with the js file being loaded in a view.

home.js
Code:
$.ajax({
    async: false,               // wait for return
    data: '',                   // no data to pass
    dataType: 'json',
    success: home.loadComplete, // function to call on return
    type: 'POST',
    url: site + "/code/ajaxGetPrefs/" // the php controller to call
  });
  ....
  loadComplete: function(json_data)
  {
    ...


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