Answer the question
In order to leave comments, you need to log in
How to add a record and update it in one form?
There is a form that adds a record.
When you click on the edit button, the data from the fields is entered into this form.
How to implement record update in the same form?
Answer the question
In order to leave comments, you need to log in
Create\find model in controller
Pass model to create\update view, depending on action
In create\update view, use echo $this->renderPartial('_form', array('model'=>$model)) passing model into the form view The form view
must contain the form code itself that works with the model + certain simple display logic, depending on whether it is a new entity or an existing one. For example, the name of the button $model->isNewRecord ? 'Create' : 'Save'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question