|
@@ -25,6 +25,8 @@ class UploaderExtension extends \Twig_Extension
|
25
|
25
|
*/
|
26
|
26
|
private $helper;
|
27
|
27
|
|
|
28
|
+ private $cacheManager;
|
|
29
|
+
|
28
|
30
|
public function __construct(UploaderHelper $helper,CacheManager $cacheManager,ContainerInterface $container)
|
29
|
31
|
{
|
30
|
32
|
$this->helper = $helper;
|
|
@@ -74,7 +76,8 @@ class UploaderExtension extends \Twig_Extension
|
74
|
76
|
}
|
75
|
77
|
|
76
|
78
|
// supprime le début du chemin car le gestionnaire de cache l'ajoute de lui même
|
77
|
|
- $assetObject = str_replace($uploadStartPath,'',$assetObject);
|
|
79
|
+ $assetObject = trim(str_replace($uploadStartPath,'',$assetObject),'/');
|
|
80
|
+
|
78
|
81
|
|
79
|
82
|
$url = $this->cacheManager->getBrowserPath($assetObject,$thumb);
|
80
|
83
|
return $url;
|