I have created a small craft cms plugin to pull some information from the DB, and everytime I execute the plugin I get a 404.
Here is the controller
namespace Craft;
class UserExists_UserControllerController extends BaseController
{
public function actionGetUser()
{
$this->returnJson($response);
}
}
And this is the jquery:
$.ajax({
url: "{{ url("actions/userexists/usercontroller/getUser") }}",
dataType: "json",
success: function(data){
console.log(data)
}
});
UserExists_UserController
—I suggest, only because the use or omission of the word "controller" in actions may become confusing! Using this class name will allow your AJAX call to be made toactions/userexists/user/getUser
, instead.UserExists_Controller
, and access it viaactions/userexists/getUser
.UserExists_UserControllerController
in?