Answer the question
In order to leave comments, you need to log in
Is it possible to use scripts in nested ActiveRecord Yii2 models?
Is it possible to somehow pass the script parameter to the nested model during the description of the relationships via hasMany() or hasOne()?
Answer the question
In order to leave comments, you need to log in
If you check for the presence of an object in afterFind() and assign your own script to it (or to them in a loop), then maybe something will work out. Maybe there are other options, wrote the most obvious.
It seems to me that this is architecturally incorrect. the controller can work with arguments. well, the maximum is the domain layer, and then they must be converted into some form that is more abstract and close to the subject area. akin to what the encoder will take in the program (the Internet browser, for example) will change the color of the window, simply by receiving the next byte from the kernel socket stack, bypassing all intermediate layers, simply because he so wanted today
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question