I'm building a website using Zend Framework and having trouble implementing modules and custom routes.
There are basically two rules:
- Select a module based on the domain (multiple domains can select a single module)
- Regardless of domain, select one specific module based on path
Examples:
- domain1.com selects module domain1
- domain1.net selects module domain1
- domain2.com selects module domain2
- both domain1.com/admin and domain2.com/admin select module admin
This is the first project where I use ZF, so my experience with the framework is basically non-existent. I have done some dirty hacking in my bootstrapper where I check the domain and than execute Zend_Layout::startMVC()
to get the correct layout, but that is messed up when I'm implementing custom routes.
So I was wondering what is the best way to go about implementing this?
Look into Zend_Route, and this post.