Hello fellow programmers,
(a bit of background)I'm building a Symfony 2 application for university Student accommodation, when our clients from the university side register with their details a subdomain is created, students belonging to a particular university can access the online accommodation service through this subdomain, there will be several universities that will be registered and each university will have their own subdomain and separate set of related-data/student-data that cannot be accessed from other universities.
(what i have already done) i managed to create a nice login and register pages and also managed to create subdomains by editing the hosts file (with file_put_contents() any better way to do this using symfony?) then i created a service that fetches the UniversityID from the parameters.yml, this way i can get university specific data since all tables have a universityID column.
should i create a script that runs before every thing is loaded that would dynamically update the UniversityID inside the parameters.yml based on the subdomain? what is the best practice for this
In conclusion, what i want from the community is,
1). i'm looking to use the Front controller to load the University Specific data, how do i load/set dynamic data using front controller and/or Kernel
2). how to create subdomains from dynamically without being platform (OS) specific
-thanks