|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* YAWIK |
|
4
|
|
|
* |
|
5
|
|
|
* @filesource |
|
6
|
|
|
* @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de) |
|
7
|
|
|
* @license MIT |
|
8
|
|
|
* @author [email protected] |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace Jobs\Factory\View\Helper; |
|
12
|
|
|
|
|
13
|
|
|
use Interop\Container\ContainerInterface; |
|
14
|
|
|
use Zend\ServiceManager\FactoryInterface; |
|
15
|
|
|
use Zend\ServiceManager\ServiceLocatorInterface; |
|
16
|
|
|
use Jobs\View\Helper\ApplyUrl; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Factory for ApplyUrl view helper |
|
20
|
|
|
* |
|
21
|
|
|
* @author Mathias Weitz <[email protected]> |
|
22
|
|
|
* @author Mathias Gelhausen <[email protected]> |
|
23
|
|
|
*/ |
|
24
|
|
|
class ApplyUrlFactory implements FactoryInterface |
|
25
|
|
|
{ |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Create an object |
|
29
|
|
|
* |
|
30
|
|
|
* @param ContainerInterface $container |
|
31
|
|
|
* @param string $requestedName |
|
32
|
|
|
* @param null|array $options |
|
33
|
|
|
* |
|
34
|
|
|
* @return object |
|
35
|
|
|
* @throws ServiceNotFoundException if unable to resolve the service. |
|
36
|
|
|
* @throws ServiceNotCreatedException if an exception is raised when |
|
37
|
|
|
* creating a service. |
|
38
|
|
|
* @throws ContainerException if any other error occurs |
|
39
|
|
|
*/ |
|
40
|
|
|
public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
41
|
|
|
{ |
|
42
|
|
|
$helper = new ApplyUrl(); |
|
43
|
|
|
$url = $container->get('url'); |
|
44
|
|
|
$translate = $container->get('translate'); |
|
45
|
|
|
$params = $container->get('params'); |
|
46
|
|
|
$serverUrl = $container->get('serverUrl'); |
|
47
|
|
|
$helper->setUrlHelper($url) |
|
48
|
|
|
->setTranslateHelper($translate) |
|
49
|
|
|
->setParamsHelper($params) |
|
50
|
|
|
->setServerUrlHelper($serverUrl); |
|
51
|
|
|
return $helper; |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
|
|
55
|
|
|
public function createService(ServiceLocatorInterface $services) |
|
56
|
|
|
{ |
|
57
|
|
|
return $this($services, ApplyUrl::class); |
|
58
|
|
|
} |
|
59
|
|
|
} |
|
60
|
|
|
|