Unable to post the data from view to controller in Yii2

前端 未结 2 968
天涯浪人
天涯浪人 2020-12-07 02:59

I am working on Yii2. I have a gridview with checkbox and on a button click I am redirecting it to an action controller using ajax.



        
2条回答
  •  半阙折子戏
    2020-12-07 04:01

    first of all url:'$DCOurl' is correct and url must be in single or double quotation. so you have a not found problem:

    • is your project in htdocs or www followed by /inventory-web/backend/ or there are some more directories? you use relative url so the url would be for ex: localhost/inventory-web/backend/web/ ...
    • ajax type 'POST' should match with behaviors['verbs']['actions'] if you have set it
    • check controller file name, class name and namespace

提交回复
热议问题