2009年10月26日星期一

Re: [fw-mvc] Seperate Public Directories Using Same Model & Config

Steve Uplift wrote:
>
> Hi,
>
> I am developing a website, which also has an admin site. Both of these are
> effectively different sites, or at least in terms of Zend MVC, seperate
> public directories. I need both sites to use the same model (as the
> databases are the same, I would be duplicating a lot of the code if I
> coded them seperately), and the same config file.
>
> What's the easiest way to do this? I know it's easy to create modules to
> use seperate controllers, views and models but they use a common public
> directory. I thought of just putting the model and config folders outside
> of both but this just feels a bit messy.
>
> Any ideas anyone?
>
> Thanks
>
> Steve
>

Hi,

I think its absolutely fine in that case to place your models in a separate
folder, like your 'library' for example. If you then put it on your include
path you can easily autoload these models from anywhere in your application.

And by the way - what do you mean by 'two public directories' since you can
have only one public webroot?

Good luck,
Dmitry.

--
View this message in context: http://www.nabble.com/Seperate-Public-Directories-Using-Same-Model---Config-tp26065263p26065420.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: