2016-05-16 57 views
0

我正在使用AjaxFOSuserBundleajaxfosuserbundle註冊symfony 2.8

並嘗試通過ajax進行註冊,但出現錯誤。這是什麼意思?

捕致命錯誤:傳遞給FOS參數1 \ UserBundle \事件監聽\ AuthenticationListener :: authenticate()的必須是FOS \ UserBundle \事件\ FilterUserResponseEvent,Tecnocreaciones \捆綁\ AjaxFOSUserBundle \事件\ 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!'); 
       } 
      } 
     }); 
    }); 
}); 
+0

請出示你的代碼 –

+0

葉氏......你可以看到它已經 –

+0

你能不能給我們在您的這個RegistrationController的registerAction方法的代碼? –

回答

0
  • 這似乎是AjaxFOSUserBundle代碼的問題。 AjaxFOSUserBundle中的FilterUserResponseEvent應該擴展FOSUserBundle類。

你應該在github項目上發佈你的問題。

+0

Yeap ..我也這麼認爲。那麼你在這裏看到什麼解決方案 –