Hello everyone,
I’m fairly new to Yii. I’ve done a small personal project in it, it wasn’t very complex. I’m now starting on a new project for work that I would like to do in Yii. However, I have some architecture questions before I begin.
What I need to create is essentially an online application. It has several pages filled with form fields that a user fills out and submits. I need the ability to quickly brand this application for various partners we have. I can store the css colors and background images and what not in a database pretty easily.
The catch is, different partners might have different form applications. I was considering making generic form applications for different levels of partners and placing them in modules. But I’m confused about how Yii should handle the url routing. I know how Yii handles routing with modules:
h**p://example.com/module1/site/index
would take you to the module1 module, the site controller, and the index action. But I want to give each partner a unique url. Something like:
h**p://example.com/partner1/site/index
Then my code would be able to recognize that specific partner name, do a database query and pull out the correct module and branding.
I don’t know how to do this elegantly. I guess I would have to modify the root index.php and do a query each time a page is requested then somehow rewrite the url on the backend to direct it to the correct module. But I need some help with this. Do you guys have any tips?