@@ -106,7 +106,8 @@ public function convertNode(DOMNode $node): DOMNode
106
106
//$this->handleRawHtml($node, $data);
107
107
108
108
if (in_array ($ node ->nodeName , array_keys ($ this ->components ))) {
109
- $ currentComponent = $ this ->components [$ node ->nodeName ];
109
+ $ matchedComponent = $ this ->components [$ node ->nodeName ];
110
+ $ usedComponent = new Component ($ matchedComponent ->getName (), $ matchedComponent ->getPath ());
110
111
111
112
if ($ node ->hasAttributes ()) {
112
113
/** @var DOMAttr $attribute */
@@ -115,17 +116,17 @@ public function convertNode(DOMNode $node): DOMNode
115
116
$ name = substr ($ attribute ->name , strpos ($ attribute ->name , ': ' ) + 1 );
116
117
$ value = $ this ->refactorTemplateString ($ attribute ->value );
117
118
118
- $ currentComponent ->addProperty ($ name , $ value , true );
119
+ $ usedComponent ->addProperty ($ name , $ value , true );
119
120
} else {
120
- $ currentComponent ->addProperty ($ attribute ->name , '" ' .$ attribute ->value .'" ' , false );
121
+ $ usedComponent ->addProperty ($ attribute ->name , '" ' .$ attribute ->value .'" ' , false );
121
122
}
122
123
}
123
124
}
124
125
125
126
$ include = $ this ->document ->createTextNode (
126
127
$ this ->builder ->createIncludePartial (
127
- $ currentComponent ->getPath (),
128
- $ currentComponent ->getProperties ()
128
+ $ usedComponent ->getPath (),
129
+ $ usedComponent ->getProperties ()
129
130
)
130
131
);
131
132
0 commit comments