Ralf Eggert wrote
> 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?
The solution I've recommended to you won't follow the way that Modules do
work. Your Module would need to include that sub namespace bit in Module.php
class, like:
namespace BS\Page;
and other resources being loaded, for ie. Controllers:
'controllers' => array(
'invokables' => array(
'Page\Controller\Page' => 'BS\Page\Controller\PageController',
),
),
Other solution which may be simpler for you is to use another, standard
autoloader just for this kind of modules.
-----
Cheers,
--
Luke Mierzwa
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/ZF2-create-own-library-tp4657032p4657044.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]