basePath should be APPLICATION_PATH . '/modules/default'

   -- Mon


On Thu, Dec 17, 2009 at 11:58 PM, Derk <[email protected]> wrote:

>
> That is one of the things I tried, but it doesn't work :(.
>
> $moduleLoader = new Zend_Application_Module_Autoloader(
>                        array(
>                                 'namespace' => 'Default_',
>                                'basePath' => APPLICATION_PATH
>                        )
>                );
>
> and the warning
> Warning:
>
> Zend_Loader_Autoloader_Resource::include(...\application/models//Article.php)
> [function.Zend-Loader-Autoloader-Resource-include]: failed to open stream:
> No such file or directory in
> ....\library\Zend\Loader\Autoloader\Resource.php on line 176
>
>
>
> Daniel Latter wrote:
> >
> > Hi,
> >
> > Add "Default_" to the namespace.
> >
> > Dan
> >
> >
> >
> > 2009/12/17 Derk <[email protected]>
> >
> >>
> >> 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.
> >>
> >
> >
>
> --
> View this message in context:
> http://n4.nabble.com/Setup-of-a-modular-structure-tp965985p966069.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>

Reply via email to