Thanks, but now something else:
How to setup autoloading of the models?

I have in my application/Bootstrap.php
        protected function _initAutoload() {
                $autoloader = Zend_Loader_Autoloader::getInstance();
                $moduleLoader = new Zend_Application_Module_Autoloader(
                        array(
                                'namespace' => '',
                                'basePath' => APPLICATION_PATH
                        )
                );
                return $moduleLoader;
        }

and in the application.ini:
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.modules = ""

The code in my Default_IndexController
$article = new Default_Model_Article;

and the class Default_Model_Article is in
application/modules/default/models/Article.php

but the error is: Fatal error: Class 'Default_Model_Article' not found in
...\application\modules\default\controllers\IndexController.php on line 14

thanks,

Derk

Daniel Latter wrote:
> 
> Hi,
> 
> I missed prefixDefaultModule, name your class FILE just
> ErrorController.php
> not Default_ErrorController.php,
> but name your class class Default_ErrorController {}.
> 
> 
> 
> 2009/12/17 Саша Стаменковић <[email protected]>
> 
>> You can remove that line from config :)
>>
>> Why do you need default prefix?
>>
>>
>> Regards,
>> Saša Stamenković
>>
>>
>>
>> On Thu, Dec 17, 2009 at 3:15 PM, Derk <[email protected]> wrote:
>>
>>>
>>> Yes, I know. But what if I also want to prefix the default module? I
>>> have
>>> already
>>> resources.frontController.prefixDefaultModule = true
>>>
>>>
>>> Daniel Latter wrote:
>>> >
>>> > Hi,
>>> >
>>> > You dont need to prefix the default module controllers with
>>> "Default_",
>>> > try
>>> > removing this.
>>> >
>>> > Thanks
>>> >
>>> >
>>> >
>>> > 2009/12/17 Derk <[email protected]>
>>> >
>>> >>
>>> >> I'm trying to set up an application with a modular structure
>>> >>
>>> >> directory structure:
>>> >>
>>> >> -application
>>> >>   - config
>>> >>   -modules
>>> >>      - default
>>> >>          -controllers
>>> >>            - Default_ErrorController.php
>>> >>      - admin
>>> >>
>>> >> And in my application.ini
>>> >> resources.frontController.defaultModule = "default"
>>> >> resources.frontController.prefixDefaultModule = true
>>> >> resources.frontController.moduleDirectory = APPLICATION_PATH
>>> "/modules"
>>> >> resources.frontController.moduleControllerDirectoryName =
>>> "controllers"
>>> >>
>>> >>
>>> >> But I get a fatal error:
>>> >> Fatal error:  Uncaught exception
>>> 'Zend_Controller_Dispatcher_Exception'
>>> >> with
>>> >> message 'Invalid controller specified (error)' in
>>> >> ......\library\Zend\Controller\Dispatcher\Standard.php:242
>>> >>
>>> >> What is the right way to set up such a structure?
>>> >>
>>> >> Regards,
>>> >> Derk
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://n4.nabble.com/Setup-of-a-modular-structure-tp965985p965985.html
>>> >> Sent from the Zend Framework mailing list archive at Nabble.com.
>>> >>
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://n4.nabble.com/Setup-of-a-modular-structure-tp965985p965999.html
>>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>>
>>
>>
> 
> 

-- 
View this message in context: 
http://n4.nabble.com/Setup-of-a-modular-structure-tp965985p966039.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to