I'm working on subsites sharing resources in ZF
Take a look at the following folders structure:

/application
        /configs
                /application.ini
        /layouts
                /scripts
                        /partials
                        /default.html
                        
/sites
        /mysite.tld
                /application
                        /configs
                                /application.ini
                        /layouts
                                /scripts
                                        /default.html
                /public
                        /index.php

There's a new folder 'sites' which contains site specific code.
The docRoots point to the various /sites/mysite.tld/public
In each index.php I define both constants for default application and site
specific one's.
Ex:

define('APPLICATION_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'application');
define('SITE_APPLICATION_PATH', SITE_BASE_PATH . DIRECTORY_SEPARATOR .
'application');


and this is for merging the two application.ini config files:

require_once 'Zend/Config/Ini.php';

$defaultConfigFile = APPLICATION_PATH . DS . 'configs' . DS .
'application.ini';
$siteConfigFile = SITE_APPLICATION_PATH . DS . 'configs' . DS .
'application.ini';

$config = new Zend_Config_Ini($defaultConfigFile, APPLICATION_ENV, true);
if (file_exists($siteConfigFile)) {
    $siteConfig = new Zend_Config_Ini($siteConfigFile, APPLICATION_ENV);
    $config->merge($siteConfig)
        ->setReadOnly();
}


In the config file I've something like this:

[development : production]
resources.layout.layoutPath             = SITE_APPLICATION_PATH 
"/layouts/scripts"
resources.layout.layout                 = "default"


That's sounds good but this way I've to recreate each resource I put in the
new application.ini 
I want to share common resources like partials, helpers and module too.

Any clue?
Should I work by Plugin?

--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Sharing-partials-modules-views-controllers-etc-between-two-ZF-sites-tp3352060p3352060.html
Sent from the Zend Framework mailing list archive at Nabble.com.

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


Reply via email to