T
T
teodor7teodor72016-07-05 14:14:19
Yii
teodor7teodor7, 2016-07-05 14:14:19

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

1 answer(s)
M
Maxim Fedorov, 2016-07-05
@qonand

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 question

Ask a Question

731 491 924 answers to any question