Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Depending on what is considered a model, if your model is \yii\base\Model - then the function for getting a static list should be placed in it.
If your model is ActiveRecord then it all depends on the data you are going to return. For example: if this is a list of some constants related to the current ActiveRecord, then it is acceptable to place it in the ActiveRecord itself (although this is not ice). If your list of data is taken from another model, then it is worth introducing a separate view model and placing the algorithm for obtaining data in it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question