diff --git a/README.md b/README.md index f58daef..c6a7dad 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ A Zend Framework 2 module to based on [Mobile-Detect](https://github.com/serbang 1. [Zend Framework 2](https://github.com/zendframework/zf2) 2. [Mobile-Detect](https://github.com/serbanghita/Mobile-Detect) 3. [zf2-mobile-detect](https://github.com/neilime/zf2-mobile-detect) -4. [HtTemplateResolverModule](https://github.com/hrevert/HtTemplateResolverModule) # Installation diff --git a/composer.json b/composer.json index e2fb385..e8ade71 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,6 @@ "zendframework/zend-modulemanager": "~2.1", "zendframework/zend-servicemanager": "~2.1", "zendframework/zend-mvc": "~2.1", - "hrevert/ht-template-resolver-module": "0.0.*", "neilime/zf2-mobile-detect": "1.0" }, "autoload": { diff --git a/config/module.config.php b/config/module.config.php index 6b8e7d6..050d8d3 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -8,16 +8,15 @@ ] ], - 'ht_template_resolver' => [ - 'resolvers_plugin_manager' => [ - 'factories' => [ - 'media_map' => 'HtMobileTemplateModule\View\Resolver\Factory\MapFactory', - 'media_path_stack' => 'HtMobileTemplateModule\View\Resolver\Factory\PathStackFactory', - ] + 'service_manager' => [ + 'factories' => [ + 'HtMobileTemplateModule\View\Resolver\Map' => 'HtMobileTemplateModule\View\Resolver\Factory\MapFactory', + 'HtMobileTemplateModule\View\Resolver\PathStack' => 'HtMobileTemplateModule\View\Resolver\Factory\PathStackFactory', + ], + 'delegators' => [ + 'ViewResolver' => [ + 'HtMobileTemplateModule\View\Resolver\Factory\ViewResolverDelegatorFactory', + ], ], - 'resolvers' => [ - 'media_map' => 4000, - 'media_path_stack' => 2000 - ] ] ]; diff --git a/src/View/Resolver/Factory/AbstractFactory.php b/src/View/Resolver/Factory/AbstractFactory.php index 7f82847..5b6cc9d 100644 --- a/src/View/Resolver/Factory/AbstractFactory.php +++ b/src/View/Resolver/Factory/AbstractFactory.php @@ -13,11 +13,8 @@ abstract class AbstractFactory implements FactoryInterface * @param ServiceLocatorInterface $resolvers * @return ResolverInterface */ - public function createService(ServiceLocatorInterface $resolvers) + public function createService(ServiceLocatorInterface $serviceLocator) { - /** @var ServiceLocatorInterface */ - $serviceLocator = $resolvers->getServiceLocator(); - $config = $this->getConfig($serviceLocator); /** @var \Mobile_Detect */ diff --git a/src/View/Resolver/Factory/ViewResolverDelegatorFactory.php b/src/View/Resolver/Factory/ViewResolverDelegatorFactory.php new file mode 100644 index 0000000..a17d3d9 --- /dev/null +++ b/src/View/Resolver/Factory/ViewResolverDelegatorFactory.php @@ -0,0 +1,24 @@ +attach($serviceLocator->get('HtMobileTemplateModule\View\Resolver\Map'), 4000); + $resolver->attach($serviceLocator->get('HtMobileTemplateModule\View\Resolver\PathStack'), 2000); + + return $resolver; + } +}