File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,7 @@ public function js()
3333 {
3434 $ renderer = $ this ->debugbar ->getJavascriptRenderer ();
3535
36- ob_start ();
37- $ renderer ->dumpJsAssets ();
38- $ content = ob_get_contents ();
36+ $ content = $ renderer ->dumpAssetsToString ($ renderer ->getAssets ('js ' ));
3937
4038 $ response = new Response ($ content , 200 , array (
4139 'Content-Type ' => 'text/javascript ' ,
@@ -49,9 +47,7 @@ public function css()
4947 {
5048 $ renderer = $ this ->debugbar ->getJavascriptRenderer ();
5149
52- ob_start ();
53- $ renderer ->dumpCssAssets ();
54- $ content = ob_get_contents ();
50+ $ content = $ renderer ->dumpAssetsToString ($ renderer ->getAssets ('css ' ));
5551
5652 $ response = new Response ($ content , 200 , array (
5753 'Content-Type ' => 'text/css ' ,
Original file line number Diff line number Diff line change @@ -62,6 +62,21 @@ public function renderHead()
6262 return $ html ;
6363 }
6464
65+ /**
66+ * Return assets as a string
67+ *
68+ * @param array $files
69+ * @return string
70+ */
71+ public function dumpAssetsToString ($ files )
72+ {
73+ $ content = '' ;
74+ foreach ($ files as $ file ) {
75+ $ content .= file_get_contents ($ file ) . "\n" ;
76+ }
77+ return $ content ;
78+ }
79+
6580 /**
6681 * Get the last modified time of any assets.
6782 *
You can’t perform that action at this time.
0 commit comments