I have a class file on root of the application, and in that class I have a public function deleteUser
method. I want to call that method from frontend via ajax. The examples I have seen are something like this:
$.ajax({
url: '/deleteUser.php',
type: 'DELETE',
success: function(){
alert('cat deleted');
}
});
But what is throwing me off is I don't have a php file that just does delete code (deleteCat.php in this above example). I have that delete code inside my class. How am I to trigger an exact method inside a class from ajax without using url:XX
?