@@ -32,22 +32,27 @@ public function __construct(
3232 public function render (): string
3333 {
3434 /** @var \Magento\Framework\View\Element\Template $block */
35- $ block = $ this ->layout ->createBlock (Template::class);
35+ $ block = $ this ->layout ->createBlock (
36+ Template::class,
37+ '' ,
38+ [
39+ 'data ' => [
40+ 'template ' => self ::TEMPLATE ,
41+ 'query ' => $ this ->query ,
42+ 'highlighted_query ' => $ this ->databaseHelper ->highlightQuery ($ this ->query ->getQuery ()),
43+ 'formatted_query ' => $ this ->databaseHelper ->formatQuery ($ this ->query ->getQuery ()),
44+ 'runnable_query ' => $ this ->databaseHelper ->highlightQuery (
45+ $ this ->databaseHelper ->replaceQueryParameters (
46+ $ this ->query ->getQuery (),
47+ $ this ->query ->getQueryParams ()
48+ )
49+ ),
50+ 'var_renderer ' => $ this ->varRenderer ,
51+ 'uniq_id ' => $ this ->mathRandom ->getUniqueHash (),
52+ ],
53+ ]
54+ );
3655
37- return $ block ->setTemplate (self ::TEMPLATE )
38- ->setData ([
39- 'query ' => $ this ->query ,
40- 'highlighted_query ' => $ this ->databaseHelper ->highlightQuery ($ this ->query ->getQuery ()),
41- 'formatted_query ' => $ this ->databaseHelper ->formatQuery ($ this ->query ->getQuery ()),
42- 'runnable_query ' => $ this ->databaseHelper ->highlightQuery (
43- $ this ->databaseHelper ->replaceQueryParameters (
44- $ this ->query ->getQuery (),
45- $ this ->query ->getQueryParams ()
46- )
47- ),
48- 'var_renderer ' => $ this ->varRenderer ,
49- 'uniq_id ' => $ this ->mathRandom ->getUniqueHash (),
50- ])
51- ->toHtml ();
56+ return $ block ->toHtml ();
5257 }
5358}
0 commit comments