Method name
Can anyone please explain what names are allowed (and what are not) for creating actions. I have a project in which I need to create many custom actions. I have wasted a lot of time trying to figure out this.
Thanks in advance for any help.
6 Replies
Any are allowed... but not if they are being used already on the page? So ensure the action would be unique is all
Somehow it is not working with some names. For example I have a Action which is used for deleting CSV files stored in the storage disk. I copied the deleteAction code in the documentation and modified it for my case and worked. But I wanted to change destroyCSVAction and suddenly the it stopped working. There was no other change, only the name of the method and the place whare it was included in the blade. I changed back and it started working again. So something is there.
In the documentation, some cryptic lines are included, something will work and something will not work. But it is not clear to me at all.
Just prefix them all with you initials:
an_delete
for example...?
Maybe this is a candidate for better error reporting? Not sure what sort of error it currently throws
Solution
Does the method name still match the action name?
Thanks Dennis. I now see the problem. When I changed the function, I did not make the change in the name, that remained the previous one. I will do the changes, I guess things will work now. Thanks again.