public function createService(ServiceLocatorInterface $sm) { $configManager = $sm->getServiceLocator()->get('Base\\Manager\\ConfigManager'); $locale = $configManager->need('i18n.locale'); $dateFormat = new DateFormat(); $dateFormat->setLocale($locale); return $dateFormat; }
/** * Creates an instance of \Core\View\Helper\Params * * - injects the MvcEvent instance * * @param ServiceLocatorInterface $serviceLocator * @return \Core\View\Helper\Params * @see \Zend\ServiceManager\FactoryInterface::createService() */ public function createService(ServiceLocatorInterface $serviceLocator) { $helper = new DateFormat(); $helper->setLocale(Locale::DEFAULT_LOCALE); return $helper; }