E
E
Eugene2018-03-29 08:49:02
Yii
Eugene, 2018-03-29 08:49:02

How to do data pulling in Yii2?

The point is. It will be valid entry form or order form. But let's say I have 12 thousand employees in the database. And everyone has a number.
So, let's say this employee enters his number in the "Personnel number" field, and the remaining fields of full name, age, etc. are filled in automatically from the database.
Seems easy, but has anyone done something like this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2018-03-29
@sidni

It’s not clear, everything seems to be just
make two models (two classes inherited from the Model class) and set up validation rules for each of the future forms (for entering a personnel number and entering everything else)
and in the template make tabs in the first display the form for the first model and in the second tabe for the second model, send it even with Ajax, even with a regular post, and that’s it ... in the controller, you implement the load and validate methods of each model and, in case of success, do what you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question