From 9e00ed4dead9d39bf5919e2f2d0f325c3fc159a8 Mon Sep 17 00:00:00 2001 From: Robert Stanfield Date: Tue, 21 Jul 2015 00:24:33 -0400 Subject: [PATCH] Delegate cache busting query string to the UrlGenerator --- src/JavascriptRenderer.php | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/JavascriptRenderer.php b/src/JavascriptRenderer.php index 3593e569..ff14394c 100644 --- a/src/JavascriptRenderer.php +++ b/src/JavascriptRenderer.php @@ -37,20 +37,16 @@ public function setUrlGenerator($url) */ public function renderHead() { - $jsModified = $this->getModifiedTime('js'); - $cssModified = $this->getModifiedTime('css'); - - $html = ''; - $html .= sprintf( - '' . "\n", - route('debugbar.assets.css'), - $cssModified - ); - $html .= sprintf( - '' . "\n", - route('debugbar.assets.js'), - $jsModified - ); + $cssRoute = route('debugbar.assets.css', [ + 'v' => $this->getModifiedTime('css') + ]); + + $jsRoute = route('debugbar.assets.js', [ + 'v' => $this->getModifiedTime('js') + ]); + + $html = ""; + $html .= ""; if ($this->isJqueryNoConflictEnabled()) { $html .= '' . "\n";