2008年12月6日星期六

Re: [fw-db] Using a zend framework model question

On Sat, Dec 6, 2008 at 11:58 AM, Jiří Helmich <jiri@helmich.cz> wrote:
> Hi,
>
> that's what the whole model thing is about :-). But you should notice that
> model has a not very strong support in ZF. You need to require its classes
> into your controllers manually (implement something like _getModel()) -
> there is no Zend_Loader method for models autoload. You should also notice
> that a model class is not derived from any Zend Framework class.

You can do the following:

Assuming your app layout is like this:
docroot/app/models/Foo.php

I added "docroot/app" to my include path and autoload takes care of the rest:

$foo = new models_Foo(); // thats's all

Till

没有评论: