3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Mvc\Service
;
12 use Zend\ServiceManager\FactoryInterface
;
13 use Zend\ServiceManager\ServiceLocatorInterface
;
14 use Zend\View\Resolver
as ViewResolver
;
16 class ViewTemplateMapResolverFactory
implements FactoryInterface
19 * Create the template map view resolver
21 * Creates a Zend\View\Resolver\AggregateResolver and populates it with the
22 * ['view_manager']['template_map']
24 * @param ServiceLocatorInterface $serviceLocator
25 * @return ViewResolver\TemplateMapResolver
27 public function createService(ServiceLocatorInterface
$serviceLocator)
29 $config = $serviceLocator->get('Config');
31 if (is_array($config) && isset($config['view_manager'])) {
32 $config = $config['view_manager'];
33 if (is_array($config) && isset($config['template_map'])) {
34 $map = $config['template_map'];
37 return new ViewResolver\
TemplateMapResolver($map);