Normally, when I'd do an ajax call to a page with jQuery's $.post(), I'd post to a specific page (i.e. ajax.php) with something like:
var submissionId = 1;
$.post('/ajax/ajax.php', {
submissionId: submissionId
}, function(data) {
alert(data);
});
and inside ajax/ajax.php, I'd manipulate the data how I'd want with $_POST['submissionId']
. What is the equivalent to this in CakePHP if I'm posting to a controller?
Do I still use $_POST['submissionId']
or $this->data
?
If using $this->data
, do I need to create a <form>
to wrap the event handler in?