F
F
Fqwd1232021-02-09 17:38:39
Yii
Fqwd123, 2021-02-09 17:38:39

How to trigger an action when a button is clicked?

Tell me, let's say I have a button to delete a user from the database, now I do it like this - they hang a link to the delete view, I pass the parameter:

<a href="<?= Url::to(['/module/customers/delete','id' => $user->id]); ?>">Update</a>

And there the action is already called which is associated with the view.
But how can I do that would just bind actionDelete to a button click, without having to go to the view?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question