|
|
|
@ -172,31 +172,33 @@ class View
|
|
|
|
$view = ob_get_clean();
|
|
|
|
$view = ob_get_clean();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
preg_match(
|
|
|
|
preg_match_all(
|
|
|
|
"/<$this->componentPrefix-(?<component>[a-z-]+)\s*(?<props>([a-z]+=\"[a-zA-Z]+\"\s*)*)?\s*\/>/",
|
|
|
|
"/<$this->componentPrefix-(?<component>[a-z-]+)\s*(?<props>([a-z]+=\"[a-zA-Z]+\"\s*)*)?\s*\/>/",
|
|
|
|
$view,
|
|
|
|
$view,
|
|
|
|
$matches,
|
|
|
|
$tagsMatches,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
if ($matches) {
|
|
|
|
$tagsMatches = array_filter($tagsMatches);
|
|
|
|
$tag = $matches[0];
|
|
|
|
|
|
|
|
$component = $matches['component'];
|
|
|
|
foreach ($tagsMatches[0] ?? [] as $tagIndex => $match) {
|
|
|
|
$props = $matches['props'] ?? '';
|
|
|
|
$tag = $match;
|
|
|
|
|
|
|
|
$component = $tagsMatches['component'][$tagIndex];
|
|
|
|
|
|
|
|
$props = $tagsMatches['props'][$tagIndex] ?? '';
|
|
|
|
|
|
|
|
|
|
|
|
preg_match_all(
|
|
|
|
preg_match_all(
|
|
|
|
'/(?<name>[a-z]+)="(?<value>[a-zA-Z]+)"/',
|
|
|
|
'/(?<name>[a-z]+)="(?<value>[a-zA-Z]+)"/',
|
|
|
|
$props,
|
|
|
|
$props,
|
|
|
|
$matches,
|
|
|
|
$propsMatches,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
$matches = array_filter($matches);
|
|
|
|
$propsMatches = array_filter($propsMatches);
|
|
|
|
|
|
|
|
|
|
|
|
if ($matches) {
|
|
|
|
if ($propsMatches) {
|
|
|
|
$props = [];
|
|
|
|
$props = [];
|
|
|
|
|
|
|
|
|
|
|
|
foreach (array_keys($matches[0]) as $index) {
|
|
|
|
foreach (array_keys($propsMatches[0]) as $propIndex) {
|
|
|
|
$name = $matches['name'][$index];
|
|
|
|
$name = $propsMatches['name'][$propIndex];
|
|
|
|
$value = $matches['value'][$index];
|
|
|
|
$value = $propsMatches['value'][$propIndex];
|
|
|
|
$props[$name] = $value;
|
|
|
|
$props[$name] = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|