From e514b1590bb85ff3ab815f83c58a79a260677d99 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Tue, 23 Sep 2014 13:08:29 +0000 Subject: [PATCH] Pass AssetUrlGenerator via constructor to ControllerResolver --- src/mibew/libs/classes/Mibew/Application.php | 4 ++-- .../classes/Mibew/Controller/ControllerResolver.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mibew/libs/classes/Mibew/Application.php b/src/mibew/libs/classes/Mibew/Application.php index 9bfee05e..74a15cfc 100644 --- a/src/mibew/libs/classes/Mibew/Application.php +++ b/src/mibew/libs/classes/Mibew/Application.php @@ -85,9 +85,9 @@ class Application implements RouterAwareInterface, AuthenticationManagerAwareInt $this->assetUrlGenerator = new AssetUrlGenerator(); $this->controllerResolver = new ControllerResolver( $this->router, - $this->authenticationManager + $this->authenticationManager, + $this->assetUrlGenerator ); - $this->controllerResolver->setAssetUrlGenerator($this->assetUrlGenerator); $this->accessCheckResolver = new CheckResolver($this->authenticationManager); } diff --git a/src/mibew/libs/classes/Mibew/Controller/ControllerResolver.php b/src/mibew/libs/classes/Mibew/Controller/ControllerResolver.php index 5dddf05b..bf7012be 100644 --- a/src/mibew/libs/classes/Mibew/Controller/ControllerResolver.php +++ b/src/mibew/libs/classes/Mibew/Controller/ControllerResolver.php @@ -53,11 +53,17 @@ class ControllerResolver implements * @param RouterInterface $router Router instance. * @param AuthenticationManagerInterface $manager Authentication manager * instance. + * @param AssetUrlGeneratorInterface $url_generator An instance of Asset + * URL generator */ - public function __construct(RouterInterface $router, AuthenticationManagerInterface $manager) - { + public function __construct( + RouterInterface $router, + AuthenticationManagerInterface $manager, + AssetUrlGeneratorInterface $url_generator + ) { $this->router = $router; $this->authenticationManager = $manager; + $this->assetUrlGenerator = $url_generator; } /**