a project with multimodules

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

a project with multimodules

huajun qi
I want to bulid a project with more than one module, I have found some way to do it, but still can not make it!

I can't find a good tutorial to address how to make it, and I have finished reading the reference guide, I still can not make a module work!


One tutorial tells to add 
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[]
 
to application's configuration file, another tutorial tells to use
$front->addModuleDirectory();
method to do this, I tried both, but neither worked!

I know these two ways both should work, so did I miss something?

And if you use modules, what is the preferred directory structure? 

application:
     controllers
     views
     modules
           user
                controllers
                views
           admin
                controllers
                views

OR

application:
     default
          controllers
          views
     user
          controllers
          views 
     admin
          controllers
          views   

And how to setup according to different directory structure?


         










--
Location:
Reply | Threaded
Open this post in threaded view
|

Re: a project with multimodules

EmanueleDeserti
After many trials and errors I've came up with this configuration  
inside application.ini:

---
resources.FrontController.moduledirectory = APPLICATION_PATH "/modules"
resources.FrontController.defaultModule = "default"
resources.Modules=''
---

BUT, I use a different directory structure:

application
        Bootstrap.php
        modules
                default
                        controller
                        models
                        views
                users
                        Bootstrap.php
                        controller
                        models
                        views
                admin
                etc...

Every module have a Bootstrap.php, except for default who use the  
application Bootstrap.

This is how I've setup my application and I feel very comfortable :)

Il giorno 21/set/09, alle ore 11:12, huajun qi ha scritto:

> I want to bulid a project with more than one module, I have found  
> some way to do it, but still can not make it!
>
> I can't find a good tutorial to address how to make it, and I have  
> finished reading the reference guide, I still can not make a module  
> work!
>
>
> One tutorial tells to add
> resources.frontController.moduleDirectory = APPLICATION_PATH "/
> modules"
> resources.modules[]
>
> to application's configuration file, another tutorial tells to use
> $front->addModuleDirectory();
> method to do this, I tried both, but neither worked!
>
> I know these two ways both should work, so did I miss something?
>
> And if you use modules, what is the preferred directory structure?
>
> application:
>      controllers
>      views
>      modules
>            user
>                 controllers
>                 views
>            admin
>                 controllers
>                 views
>
> OR
>
> application:
>      default
>           controllers
>           views
>      user
>           controllers
>           views
>      admin
>           controllers
>           views
>
> And how to setup according to different directory structure?
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Location:

---
Emanuele Deserti
Netwing S.r.l.
<[hidden email]>
Tel.: 0532 - 1912002
http://www.netwing.it

Reply | Threaded
Open this post in threaded view
|

Re: a project with multimodules

padraicb
In reply to this post by huajun qi
Your configuration is correct, but you need to have a module bootstrap also. Even if it's just an empty class extending Zend_Application_Module_Bootstrap stored at modulename/Bootstrap.php, e.g.

class Admin_Bootstrap extends Zend_Application_Module_Bootstrap {}

The directory structure you picked also look fine. People use different setups of course, but so long as the modules are in whatever directory you picked as the module directory, it works fine.
 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative



From: huajun qi <[hidden email]>
To: [hidden email]
Sent: Monday, September 21, 2009 10:12:42 AM
Subject: [fw-mvc] a project with multimodules

I want to bulid a project with more than one module, I have found some way to do it, but still can not make it!

I can't find a good tutorial to address how to make it, and I have finished reading the reference guide, I still can not make a module work!


One tutorial tells to add 
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[]
 
to application's configuration file, another tutorial tells to use
$front->addModuleDirectory();
method to do this, I tried both, but neither worked!

I know these two ways both should work, so did I miss something?

And if you use modules, what is the preferred directory structure? 

application:
     controllers
     views
     modules
           user
                controllers
                views
           admin
                controllers
                views

OR

application:
     default
          controllers
          views
     user
          controllers
          views 
     admin
          controllers
          views   

And how to setup according to different directory structure?


         










--
Location: