Source of file HelperConfig.php
Size: 1,542 Bytes - Last Modified: 2014-03-12T23:21:18+01:00
/home/theseer/Downloads/ZendFramework-2.3.0/library/Zend/Navigation/View/HelperConfig.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Navigation\View; use Zend\ServiceManager\ConfigInterface; use Zend\ServiceManager\ServiceManager; use Zend\View\HelperPluginManager; /** * Service manager configuration for navigation view helpers */ class HelperConfig implements ConfigInterface { /** * Configure the provided service manager instance with the configuration * in this class. * * Simply adds a factory for the navigation helper, and has it inject the helper * with the service locator instance. * * @param ServiceManager $serviceManager * @return void */ public function configureServiceManager(ServiceManager $serviceManager) { $serviceManager->setFactory('navigation', function (HelperPluginManager $pm) { $helper = new \Zend\View\Helper\Navigation; $helper->setServiceLocator($pm->getServiceLocator()); $config = $pm->getServiceLocator()->get('config'); if (isset($config['navigation_helpers'])) { $config = new \Zend\ServiceManager\Config($config['navigation_helpers']); $config->configureServiceManager($helper->getPluginManager()); } return $helper; }); } } |