Hey Adamquadmon,

I'm working on subsites sharing resources in ZF

The way that I've seen this work rather well in the past, is if you use multiple layouts to render the site. Would the backend and any functionality will be the same across both sites?

Here's a working example:
http://www.tafchapters.org/
http://www.tigerboosterclubs.org/

^^ Is this what you're looking for?

Both of these sites and each of their subdomains use the same ZF. The only difference between the two is which layout is rendered on each site based on the subdomain.

If this is the case, then you will want to go with a directory structure like 
this:

zf-layout/
├── application
│   ├── configs
│   │   ├── application.ini
│   │   ├── site1.ini
│   │   ├── site2.ini
│   │   ├── site3.ini
│   │   ├── site4.ini
│   │   └── site5.ini
│   ├── controllers
│   │   └── IndexController.php
│   ├── layouts
│   │   └── scripts
│   │       ├── site1
│   │       │   └── layout.phtml
│   │       ├── site2
│   │       │   └── layout.phtml
│   │       ├── site3
│   │       │   └── layout.phtml
│   │       ├── site4
│   │       │   └── layout.phtml
│   │       └── site5
│   │           └── layout.phtml
│   ├── models
│   ├── modules
│   └── views
│       └── scripts
├── cache
├── htdocs
├── library
│   ├── My
│   │   └── Controller
│   │       └── Plugin
│   │           └── Layout.php
│   └── Zend
├── logs
└── tests

As you can see, you can have your central application.ini config for the master portion of the site. Then you can have your own site-specific configuration for each site you create and have it overwritten as you need. By default, the layout would render site1 (or the main site). You could create a front-controller plugin "My_Controller_Plugin_Layout" and in the preDispatch, determine the layout to use, based on the current domain ($request->getServer('HTTP_HOST')).

The bootstrap could have it's own _initConfigs() method, in which it determines which INI file to use to load into the application configs based on the domain name.

This should get you on your way :)

Let me know if you have any questions,
-Kizano
//-----
Information Security
eMail: [email protected]
http://www.markizano.net/

--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to