Pass AssetUrlGenerator via constructor to ControllerResolver

This commit is contained in:
Dmitriy Simushev 2014-09-23 13:08:29 +00:00
parent 2bb6899c33
commit e514b1590b
2 changed files with 10 additions and 4 deletions

View File

@ -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);
}

View File

@ -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;
}
/**