要将serviceLocator注入到任何类中

   如果想要在任何类中都用到zf2的serviceLocator, 在类中实现serviceLocatorAwareInterface,然后getServiceConfig 方法中注册成服务即可直接使用该类中的serviceLocator

原文地址:https://www.cnblogs.com/musings/p/serviceLocator.html