Hi Luke,

Thanks for your reply.

> My recommendation is the first option you've pointed out. It''s very
> flexible in terms of reusing stuff.
> I'm using sub namespaces for my vendor common Modules. I have it structured
> like that: vendor/BS/ModuleName1, vendor/BS/ModuleName2, etc.
> In my application config I'm loading them in this way:
> return array(
>     'modules' => array(
>         'Test',
>         'BS\ModuleName1', // loading module from vendor when no config
> override is needed
>         'BS\ModuleName2', // loading module from vendor...
>         'ModuleName2', // ...from /modules folder to override settings of
> the 'BS\ModuleName2'
>         'Application',
>     ),
>     'module_listener_options' => array(
>         'config_glob_paths'    => array(
>             'config/autoload/{,*.}{global,local}.php',
>         ),
>         'module_paths' => array(
>             './module',
>             './vendor',
>         ),
>     ),
> );

I created /vendor/ralfeggert/travello/ now which holds a simple
Module.php which just outputs a text to check the module loading.

My /config/application.config.php looks like this:

------------------------------------------------------------------
return array(
    'modules' => array(
        'Application',
        'ralfeggert\travello',
    ),
    'module_listener_options' => array(
        'config_glob_paths'    => array(
            'config/autoload/{,*.}{global,local}.php',
        ),
        'module_paths' => array(
            './module',
            './vendor',
        ),
    ),
);
------------------------------------------------------------------

That does not work.

  Fatal error: Uncaught exception 'Zend\ModuleManager\Exception
  \RuntimeException' with message 'Module (ralfeggert\travello)
  could not be initialized.'

Switching the \ to a / does not help either. But this does help:

------------------------------------------------------------------
return array(
    'modules' => array(
        'Application',
        'travello',
    ),
    'module_listener_options' => array(
        'config_glob_paths'    => array(
            'config/autoload/{,*.}{global,local}.php',
        ),
        'module_paths' => array(
            './module',
            './vendor',
            './vendor/ralfeggert',
        ),
    ),
);
------------------------------------------------------------------

It works, but feels wrong. What am I missing?

Regards,

Ralf

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to