if I have a service manager in the module Category, such as, can I have read from Category in module Application?
I have done so in Module.php in Application, 'list-category' is located in the module.config.php file of the module Category:
public function onDispatch(MvcEvent $e)
{
// get service manager from the application object
$sm = $e->getApplication()->getServiceManager();
// get categories service
$categories = $sm->get('list-category');
// get view model
$vm = $e->getViewModel();
// store category list in a variable
$vm->setVariable('categories', $categories);
}
I have read the service manager by in Module Category in Application.