Answer the question
In order to leave comments, you need to log in
How to get id for submission in Yii2 ActiveForm?
Good afternoon, there is an ActiveForm that, for example, when editing a user, when opening it, it would receive an identifier. What is the best way to do it? For example, what would be the hidden field? How can I include an id in an action so that it can be sent using REST. For example www.url.com/rest/users/{id}. Share who uses what.
Answer the question
In order to leave comments, you need to log in
Form the desired url and set it in the action property
$form = ActiveForm::begin([
'action' => "www.url.com/rest/users/{$id}"
])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question