![](/img/trans.png)
[英]Yii2, Component, Make a single instance and access it everywhere in the web application
[英]how to use single yii2 web application with different URL and databases
我想將單個yii2 Web應用程序與多個數據庫和URL一起使用。
實際上,我在單個Web服務器上只有一個Web應用程序,並且希望將其訂閱給不同的用戶/公司。 每個公司都有自己的獨立數據庫。 例如
company1 will want url xyz.com with database db1.
company2 will want url ab.xyz.com with database db2.
company3 will want url cd.xyz.com with database db3.
company4 will want url ef.xyz.com with database db4.
如何在yii2 Web應用程序中實現上述方案? 網址也應與公司相關(例如,如果company3登錄,則網址應為cd.xyz.com/login;如果company4要登錄,則網址應為ef.xyz.com/login,依此類推。)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.