N
N
nooclik2019-04-23 19:11:43
Yii
nooclik, 2019-04-23 19:11:43

Where is the best place to store Yii2 search models?

Good afternoon! A question about the structure of a basic application, it’s more competent to store search models in the models folder with the main application models, or else move them to a separate directory, let’s say to the root of the application, so that when their number grows, you don’t get porridge from models

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2019-04-23
@webinar

let's go to the root

strange idea, this is the last place where they will be looked for
either in the app/models folder or in the app/models/search folder
sometimes it is convenient to use modules to avoid porridge, but not always. But it's worth thinking about this.

E
Evgeny Romashkan, 2019-04-23
@EvgeniiR

Keep related items nearby.
Product search model next to the Product model, category search model next to the category.
It makes no sense to allocate a folder for "all" search models,
see Project structure, LIFT

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question