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
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.