[英]ajaxfosuserbundle registration symfony 2.8
I'm using AjaxFOSuserBundle 我正在使用AjaxFOSuserBundle
and trying to make registration via ajax, but getting an error. 并尝试通过ajax进行注册,但出现错误。 What does it mean?
这是什么意思?
Catchable Fatal Error: Argument 1 passed to FOS\\UserBundle\\EventListener\\AuthenticationListener::authenticate() must be an instance of FOS\\UserBundle\\Event\\FilterUserResponseEvent, instance of Tecnocreaciones\\Bundle\\AjaxFOSUserBundle\\Event\\FilterUserResponseEvent given 可捕获的致命错误:传递给FOS \\ UserBundle \\ EventListener \\ AuthenticationListener :: authenticate()的参数1必须是FOS \\ UserBundle \\ Event \\ FilterUserResponseEvent的实例,Tecnocreaciones \\ Bundle \\ AjaxFOSUserBundle \\ Event \\ FilterUserResponseEvent的实例
$(function ()
{
$('form#fos_user_registration_form').submit(function (e) {
e.preventDefault();
var $this = $(e.currentTarget);
inputs = {};
// Send all form's inputs
$.each($this.find('input'), function (i, item) {
var $item = $(item);
inputs[$item.attr('name')] = $item.val();
});
// Send form into ajax
$.ajax({
url: $this.attr('action'),
type: 'POST',
dataType: 'json',
data: inputs,
success: function (data) {
if (data.has_error) {
// Insert your error process
alert('WRONG');
}
else {
// Insert your success process
alert('check your email!');
}
}
});
});
});
You should post your issue on the github project. 您应该将您的问题发布在github项目上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.