I have the same problem, 

but I THINK I am near the solution.


Try to add on your 1.8 bootstrap this method

    protected function _initFront(){
      $config = new 
Zend_Config_Ini(CONFIGS_PATH.'application.ini',APPLICATION_ENV); // you can 
skip this
      $frontController = Zend_Controller_Front::getInstance();
      $frontController->throwExceptions((bool)$config->front->throwExceptions); 
// you can skip this
      $frontController->returnResponse((bool)$config->front->returnResponse); 
// you can skip this
      $frontController->registerPlugin(new 
Zend_Controller_Plugin_ErrorHandler());
      
      $frontController->setControllerDirectory(
        array(
          'default' => APPLICATION_PATH.'default/controllers',
          'admin' => APPLICATION_PATH.'admin/controllers'
        )
      );
      $frontController->setParam('useDefaultControllerAlways', true);
      
      // Istanziamo router
      $router = $frontController->getRouter();
      
      // Aggiunta della route contenente la lingua
      $route = new Zend_Controller_Router_Route(':module/*');
      $router->addRoute('byModule', $route);
    }

where the important part is setControllerDirectory method, the route byModule 
and this line 
$frontController->setParam('useDefaultControllerAlways', true);


Also add this on your initView method ( or where you like I think... )

      Zend_Layout::startMvc(
        array(
          'layoutPath' => APPLICATION_PATH.'default'.DS.'views'.DS.'layouts',
          'layout' => 'default',
          'pluginClass' => 'My_Layout_Controller_Plugin_Layout'
        )
      );




Where My_Layout_Controller_Plugin_Layout basically is

  class My_Layout_Controller_Plugin_Layout extends 
Zend_Layout_Controller_Plugin_Layout
  {
    public function preDispatch(Zend_Controller_Request_Abstract $request){
      $controller = strtoupper($request->getControllerName());
      $action = strtoupper($request->getActionName());
      
      echo $request->getModuleName(); // you will get it
      exit;
  }
}

and is saved in library/My/Layout/Controller/Plugin/Layout.php.
This Controller Plugin will help you switching layouts.

I'm working on it right now...

Hope this helps

Sergio Rinaudo



Date: Wed, 6 May 2009 15:57:00 +0300
From: vadim...@gmail.com
To: fw-general@lists.zend.com
Subject: [fw-general] Bootstrapping modules

Hey,

Are there any tutorials/guides out there that show examples on ways to 
bootstrap an application using more then one module? I mean if i have a 
directory structure like this:

-library
---Zend

-public
---admin
-----default
-----other
---site
-----default
-----other
---index.php
-application
---configs
-----application.ini
---modules
-----admin

-------controllers

-------layouts

---------scripts
-----------default
-----------other

-------views

---------scripts
-----------default

-----------other

---------helpers
-----site

-------controllers

-------layouts

---------scripts
-----------default

-----------other

-------views

---------scripts
-----------default

-----------other

---------helpers

Basically i am looking for creating a modeler structure application using ZF 
1.8, Is there anything blogged about it?

Thanks.
 
-- 
Vincent Gabriel.
Lead Developer, Senior Support.

Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/





Scrivi, parla e gioca con i tuoi amici! Scarica Messenger 2009!
_________________________________________________________________
PiĆ¹ di 100 Emoticon gratis per il tuo Messenger!
http://intrattenimento.it.msn.com/emoticon

Reply via email to