Ajax form submission in symfony2 with graceful degradation for users without javascript

后端 未结 3 1362
悲&欢浪女
悲&欢浪女 2021-01-30 04:57

I am building a web application that involves forms. The framework being used is symfony2. I would like to have everything working for users without javascript, and then progres

3条回答
  •  情话喂你
    2021-01-30 05:11

    As long as you can generalize the sort of response needed for non-ajax forms and for ajax forms, you can relegate that decision of ajax/non-ajax to another method and then simply have:

    return handleResponseType(whateverInfoIsNeededToHandleIt)
    

    You then have full control over what gets passed in to your deciding function.

提交回复
热议问题