Im using the ZF 2 Framework and have the follow scenario.
- Company can register
- After Register it creates a subdomain (need changes in the
.htaccess)
Example :
- site.com => Frontend
- company_a.site.com => Frontend for Company (company_id=1)
- compaby_b.site.com => Frontend for Company (company_id=2)
What i want is that when a Users goes to company_a.site.com or company_b.site.com, that the Route is the same in the Application but the Data from DB depens on the subdomain name.
How i think it must work :
- User comes to company_a.site.com
- In the Main Controller i will make a Query to DB to see if exists a company with name "company_a" and if is so then assign a
global variable with the company ID from the DB. So i can based on
that ID load the content for the frontend.