I have a Javascript function that invoke a cakephp controller method:
$.ajax({
type: "POST",
url: 'http://localhost/cakephp/officepersontasks/add',
data: {
company_id: $("#company_id").val(),
person_id: $("#person_id").val(),
task_id: "11"
},
success: function(data) {
alert('Load was performed.'+data);
}
});
On the cakeside, the object $this->request->data
contain sended data, so $this->OfficePersonTask->save($this->request->data)
will save data against OfficePersonTask
model. The problem is that data sended got to be splitted, some data will be saved inside a DB table, the rest of data will be saved in a second table? What's the best solution to do this? How can I explode $this->request->data
object?