« Return to Thread: Shared Models in Different Modules

Re: Shared Models in Different Modules

by Simon Mundy :: Rate this Message:

Reply to Author | View in Thread

Check out Ralph's proposal at http://framework.zend.com/wiki/display/ZFPROP/Zend_Controller_Action_Helper_ModelLoader

It may be close to what you're after?

==== QUOTE ====
Perhaps we need a Zend_Loader::loadModel to load the required models
in each Action Controller, and of course, there could be a method, say,
setModuleModelDirectoryName().

The problem or issue i see with this is if you have a bunch of modules it would be pain to always keep modifying your bootstrap file to keep track of these.

what would be ideal is if when this command is given:
   ->addModuleDirectory($this->dirApplication . DIRECTORY_SEPARATOR . 'modules')
it would register all the model directories or something like that to handle it.

Not sure how it would be done but it's an idea.



Jon Whitcraft
Indianapolis Motor Speedway
jwhitcraft@...

________________________________

From: AmirBehzad Eslami [mailto:behzad.eslami@...]
Sent: Sun 12/2/2007 4:47 PM
To: Luke Crouch
Cc: Whitcraft, Jon; fw-mvc@...
Subject: Re: [fw-mvc] Shared Models in Different Modules


In my opinion, each Module should be self-contained. Let's look at
each module as a package. This allows you create new projects
via the well-known copy-paste technique! However, the default
module needs access to other models to collect the magnet content.

We can put "./application/modules" into the include_path.
But we cannot use the Zend_Loader to load models using the
following syntax: Zend_Loader('{modulename}_models_{ModelName}').
Because Zend_Loader checks for the class name to match via
the given parameter.

Perhaps we need a Zend_Loader::loadModel to load the required models
in each Action Controller, and of course, there could be a method, say,
setModuleModelDirectoryName().

-B
********************
********************
This E-mail (and attachments) may contain confidential/privileged information intended only for the named addressee(s). If you are not an intended recipient, do not read, copy, disseminate or take any action based on the content of this E-mail. Please notify the sender by reply E-mail and erase this E-mail from your system. Your assistance is appreciated. E-mail transmission may not be secure or error-free. The company is not responsible for any loss/damage arising from any virus transmitted.
********************
********************

--

Simon Mundy | Director | PEPTOLAB

""" " "" """""" "" "" """"""" " "" """"" " """"" "  """""" "" "

PeptoLab will be closed:
Saturday 15th  December through until Monday 17th December 
Saturday 22nd December through until Wednesday 2nd January
For urgent requests, please call 0438 046 061

202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124
http://www.peptolab.com

 « Return to Thread: Shared Models in Different Modules