View Helper Manager not accessible in Module Bootstrap using ZF3

Deadly 提交于 2019-12-23 15:07:23

问题


Using Zend Framework 2 I can access the ViewHelperManager doing this:

public function onBootstrap(MvcEvent $e)
   $viewHelperManager = $e->getApplication()->getServiceManager()->get('viewHelperManager');
}

This does not seem to work anymore in my Modules since starting a new project using Zend Framework 3.

Not quite sure what to do here.


回答1:


The Services are uppercased in Zend Framework 3 apparently.

$viewHelperManager = $e->getApplication()->getServiceManager()->get('ViewHelperManager');
var_dump(get_class($viewHelperManager));

returns string(29) "Zend\View\HelperPluginManager"



来源:https://stackoverflow.com/questions/39186928/view-helper-manager-not-accessible-in-module-bootstrap-using-zf3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!