2008年9月24日星期三

Re: [fw-mvc] including models within the controller

Thanks for your help.
It works.
Its just a pitty that just as you have the function ' setControllerDirectory'  you should have setModelDirectory.
I just added my controller directory to the include path and that was enough.

On Wed, Sep 24, 2008 at 11:23 AM, Giorgio Sironi <piccoloprincipeazzurro@gmail.com> wrote:
2008/9/24 Jigal sanders <jigalroecha@gmail.com>:
> In my boodstrap file I use the autoloader which loads all the classes which
> I need correctly. But in my controllers, whenever I want to use a class
> which exists in my models follder i have to use require_once('filename ');
> Is this correct or is there a way to do this in a way like the autoloader?

My solution was subclassing Zend_Loader to make it manage prefixes:
http://ossigeno.svn.sourceforge.net/viewvc/ossigeno/trunk/core/library/Otk/Loader.php?view=markup
and register ITS autoload function instead of the Zend_Loader one.
In my bootstrap I add associations like 'moduleName' =>
'application/modules/moduleName/models'.


--
Giorgio Sironi
Piccolo Principe & Ossigeno Scripter
http://www.sourceforge.net/projects/ossigeno



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

没有评论: