Skip to content

Commit

Permalink
Remove URL generator dependancy
Browse files Browse the repository at this point in the history
Better for Lumen
  • Loading branch information
barryvdh committed Jan 2, 2016
1 parent 4cedec8 commit 71b13b9
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/JavascriptRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ class JavascriptRenderer extends BaseJavascriptRenderer
// Use XHR handler by default, instead of jQuery
protected $ajaxHandlerBindToJquery = false;
protected $ajaxHandlerBindToXHR = true;

/** @var \Illuminate\Routing\UrlGenerator */
protected $url;

public function __construct(DebugBar $debugBar, $baseUrl = null, $basePath = null)
{
Expand All @@ -28,33 +25,30 @@ public function __construct(DebugBar $debugBar, $baseUrl = null, $basePath = nul
* Set the URL Generator
*
* @param \Illuminate\Routing\UrlGenerator $url
* @deprecated
*/
public function setUrlGenerator($url)
{
$this->url = $url;

}

/**
* {@inheritdoc}
*/
public function renderHead()
{
if (!$this->url) {
return parent::renderHead();
}

$jsModified = $this->getModifiedTime('js');
$cssModified = $this->getModifiedTime('css');

$html = '';
$html .= sprintf(
'<link rel="stylesheet" type="text/css" href="%s?%s">' . "\n",
$this->url->route('debugbar.assets.css'),
route('debugbar.assets.css'),
$cssModified
);
$html .= sprintf(
'<script type="text/javascript" src="%s?%s"></script>' . "\n",
$this->url->route('debugbar.assets.js'),
route('debugbar.assets.js'),
$jsModified
);

Expand Down

0 comments on commit 71b13b9

Please sign in to comment.