Modules and custom routes

Posted by Dennis Haarbrink on Stack Overflow See other posts from Stack Overflow or by Dennis Haarbrink
Published on 2011-02-02T11:14:55Z Indexed on 2011/02/15 23:25 UTC
Read the original article Hit count: 235

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?

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about routes