Hi, I'd like to avoid code duplication in an application that will be used by several clients. Most of the Clients have the same behavior with some differences regarding the layout (css mostly), some will have the same actions with different behavior and some will have unique actions.
So I am considering using a custom router to map www.foo.com/client1/module/action to be the directed to client1 and so on. I will probably use the info found at http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.basicto change the default route. But I need an extra advice... In order to reduce the duplication I'd like to have something like this /myapplication/default /myapplication/blog /myapplication/news ... Each module would use the standard directory structure /myapplication/moduleX/ (application - models/views/controllers/config, html - css, js) So if I try to access www.foo.com/client1/blog it will first check if there is a local implementation in /client1/blog and use it. If it does not found it will use the default one. All modules/controllers/actions, even those not found in the client1 directory, should first try to use the local views since I can have different layouts for the clients My question is how can I do this in an effective way or if there is a better approach. I am not familiar but someone told me that this is similar of what zope does, 'using' everything from the upper levels until it founds something locally that overrides that. I hope I was clear enough. thanks.
