Question

I am new to ZF2. I am trying to use EdpDiscuss module, I've downloaded from here. I put the main file to modules, and added module to application.config.php. When I var_dump active modules

$modules = $this->getEvent()->getApplication()->getServiceManager()->get('modulemanager')->getLoadedModules();
$moduleNames = array_keys($modules);
var_dump($moduleNames);

It shows EdpDiscuss as it should, but how can I use it? There are no routes in module.config.php so it has no pages. I also tried to use it as service:

$service = $sm->getServiceLocator()->get('edpdiscuss');

but I was not succesfull either. Can you please tell me how to use this module?

Thanks

Was it helpful?

Solution

There is an example project you can use: https://github.com/EvanDotPro/EdpForum

Basically, the service can be obtained with:

$discussService = $this->getServiceLocator()->get('edpdiscuss_discuss_service');

After that, you can use methods of the service by exploring its public interface:

https://github.com/EvanDotPro/EdpDiscuss/blob/master/src/EdpDiscuss/Service/Discuss.php

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top