문제

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top