V
V
Vlad Osadchyi2018-11-01 17:18:41
Yii
Vlad Osadchyi, 2018-11-01 17:18:41

How to change the fields in Create and Update in a form created in gii CRUD Generator?

there is a table with three fields (A, B and C)
created a model of this table in gii
created CRUD in gii
in the resulting form, you can set all the fields, but I need it so that the "C" field could not be set when adding a record to the table

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-11-01
@VladOsadchyi

and I need it so that the field "C" could not be set when adding a record to the table

1. you can simply remove it from the form
2. you can delete the validation rule, then even if there is data in the post, they will not be saved, since they will not pass validation.
3. You can make a separate model inherited from Model and not from AR and create only fields A, B in it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question