Answer the question
In order to leave comments, you need to log in
Using each other's models between 2 sites in Yii 1.xx?
There are 2 sites on Yii 1 (each as a separate application), the task is to make widgets of one on the other, as well as use some models of one site on the other (counter). The question arose of how exactly it is better to use models (including relations) of one on the other. I didn’t find a ready-made recipe, I think to use namespaces and make 2 db components on each site (conditionally db1 for working with my own models, db2 for third-party ones), share your experience on how best to implement this?
Answer the question
In order to leave comments, you need to log in
An unnecessary complication is trying to reach one model from another site. Since the model is not just a file in a vacuum, it is a part of the site that depends on its settings and so on.
Want to be simple and uncomplicated? Copy the model of one site to another, set up a connection in it to the database of another site and take data from the database. If you want to do api correctly, it's not as scary as it sounds. And what you propose is more complicated and dumber than any of the options I have proposed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question