addAction function called on page load
When I have a repeater with an addAction function. When I load the page with the repeater on it the
addAction
code is executed. I would expect this to be called only when pressing the action button.
Any suggestions?
Thanks.3 Replies
It’s because you are calling dump. It will just execute. Typically to override the action itself you would use injection to get the $action that is registered on the field and override it in the callback. Like $action->action() etc.
Hey @awcodes tnx voor your reply.
The way I understand it is that I don't call dump. What I intend to do with this code is that when I press the add button, only then the
dump
should be executed. So I don't understand why the addAction is called when I don't press the add button.
ohhhh
is this what I am supposed to do?
Probably