@@ -25,33 +25,45 @@ public function __construct(
2525
2626 public function renderMainScript (Field $ field ): string
2727 {
28- return $ this ->layout ->createBlock (Template::class, 'category_selection_main_script ' )
29- ->setData ('field ' , $ field )
30- ->setTemplate ($ this ->getMainScript ())
31- ->toHtml (); // @phpstan-ignore bitExpertMagento.setTemplateDisallowedForBlock
28+ return $ this ->layout ->createBlock (Template::class, 'category_selection_main_script ' , [
29+ 'data ' => [
30+ 'field ' => $ field ,
31+ 'template ' => $ this ->getMainScript (),
32+ ]
33+ ])
34+ ->toHtml ();
3235 }
3336
3437 public function renderChildNode (CategoryTreeNode $ categoryTreeNode , Field $ field ): string
3538 {
36- return $ this ->layout ->createBlock (Template::class, 'category_selection_inner_item_ ' . $ categoryTreeNode ->id )
37- ->setData ('category_tree_node ' , $ categoryTreeNode )
38- ->setData ('field ' , $ field )
39- ->setTemplate ($ this ->getChildItemTemplate ())
40- ->toHtml (); // @phpstan-ignore bitExpertMagento.setTemplateDisallowedForBlock
39+ return $ this ->layout ->createBlock (Template::class, 'category_selection_inner_item_ ' . $ categoryTreeNode ->id , [
40+ 'data ' => [
41+ 'category_tree_node ' => $ categoryTreeNode ,
42+ 'field ' => $ field ,
43+ 'template ' => $ this ->getChildItemTemplate (),
44+ ]
45+ ])
46+ ->toHtml ();
4147 }
4248
4349 public function renderBreadcrumb (): string
4450 {
45- return $ this ->layout ->createBlock (Template::class, 'categories_selection_crumbs ' )
46- ->setTemplate ($ this ->getBreadcrumbsTemplate ())
47- ->toHtml (); // @phpstan-ignore bitExpertMagento.setTemplateDisallowedForBlock
51+ return $ this ->layout ->createBlock (Template::class, 'categories_selection_crumbs ' , [
52+ 'data ' => [
53+ 'template ' => $ this ->getBreadcrumbsTemplate (),
54+ ]
55+ ])
56+ ->toHtml ();
4857 }
4958
5059 public function renderSearchInput (): string
5160 {
52- return $ this ->layout ->createBlock (Template::class, 'category_selection_search_input ' )
53- ->setTemplate ($ this ->getSearchInputTemplate ())
54- ->toHtml (); // @phpstan-ignore bitExpertMagento.setTemplateDisallowedForBlock
61+ return $ this ->layout ->createBlock (Template::class, 'category_selection_search_input ' , [
62+ 'data ' => [
63+ 'template ' => $ this ->getSearchInputTemplate (),
64+ ]
65+ ])
66+ ->toHtml ();
5567 }
5668
5769 /**
0 commit comments