In delete action wich generated by crud we got code like this:
In views
and in cotroller sth like this:
How if I have multiple delete in my controller? like "actionDeleteAccount", "actionDeleteGroups", etc…?
In delete action wich generated by crud we got code like this:
In views
and in cotroller sth like this:
How if I have multiple delete in my controller? like "actionDeleteAccount", "actionDeleteGroups", etc…?
You need to differentiate them using either 'submit' or 'params'.
I tried like this:
In controller:
In views
But it doesn't works…
What is the problem?
After linkButton Delete clicked, no thing happen in the page. But, submit post is working, becouse if I refresh the pages, confirm to resend data is show up.
I tried to remove all redirect function in actionDelete, nothing happen and no error, just like refresh the page.
Then I tried to remove if(Yii::app()->request->isPostRequest), It's same like above.
And for last I remove actionDelete, it just refresh the page after linkbutton clicked. So, why "actionDelete" not working in this case?
I found the answer… and solved the half problem…
After delete button clicked, the post still under actionAccount and keep working on actionAccount:
Code above is working…
But, it's make a new question, how to make post submit going to actionDelete?
You can specify the 'submit' option as follows:
'submit'=>array('delete')
Thank Qiang… so simply