File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
lib/internal/Magento/Framework/View/Element Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,27 @@ class BlockFactory
27
27
*
28
28
* @param ObjectManagerInterface $objectManager
29
29
*/
30
- public function __construct (ObjectManagerInterface $ objectManager )
30
+
31
+ /**
32
+ * Object manager config
33
+ *
34
+ * @var \Magento\Framework\ObjectManager\ConfigInterface
35
+ */
36
+ protected $ config ;
37
+
38
+ /**
39
+ * Constructor
40
+ *
41
+ * @param ObjectManagerInterface $objectManager
42
+ * @param \Magento\Framework\ObjectManager\ConfigInterface $config
43
+ */
44
+ public function __construct (
45
+ ObjectManagerInterface $ objectManager ,
46
+ \Magento \Framework \ObjectManager \ConfigInterface $ config
47
+ )
31
48
{
32
49
$ this ->objectManager = $ objectManager ;
50
+ $ this ->config = $ config ;
33
51
}
34
52
35
53
/**
@@ -43,6 +61,10 @@ public function __construct(ObjectManagerInterface $objectManager)
43
61
public function createBlock ($ blockName , array $ arguments = [])
44
62
{
45
63
$ blockName = ltrim ($ blockName , '\\' );
64
+ $ configArguments = $ this ->config ->getArguments ($ blockName );
65
+ if (isset ($ configArguments ['data ' ])) {
66
+ $ arguments ['data ' ]+= $ configArguments ['data ' ];
67
+ }
46
68
$ block = $ this ->objectManager ->create ($ blockName , $ arguments );
47
69
if (!$ block instanceof BlockInterface) {
48
70
throw new \LogicException ($ blockName . ' does not implement BlockInterface ' );
You can’t perform that action at this time.
0 commit comments