[eluser]zrowcrypt[/eluser]
JQuery's AJAX ".get" method calls a (php page)method of a controller and the returned data is further processed....but then as we consider it a best practice, controllers are meant to just transfer control to the models and views..A controller never returns anything or echoes any data...so how can we support this argument? I may be wrong..still in the initial learning stages so pardon me if you find the question a bit too naive
.
One eg. is JQuery's autocomplete plugin that I was trying to implement which expects an array of users name from the database. Generally, with CI..the flow is View form -> Controller -> Database Model(DATA) -> Controller (DATA)-> Another view...but if I have to implement the JQuery/AJAX way then the controller will have to output data so that the AJAX calling function (get) can grab it. Right?
Thanks for replying.