|
@@ 37-48 (lines=12) @@
|
| 34 |
|
return $viewContents; |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
protected function parseSelfClosingTags(string $viewContents, Component $component): string |
| 38 |
|
{ |
| 39 |
|
$prefix = $this->bladeX->getPrefix(); |
| 40 |
|
|
| 41 |
|
$pattern = "/<\s*{$prefix}{$component->tag}\s*(?<attributes>.*)\s*\/>/"; |
| 42 |
|
|
| 43 |
|
return preg_replace_callback($pattern, function (array $matches) use ($component) { |
| 44 |
|
$attributes = $this->getAttributesFromAttributeString($matches['attributes']); |
| 45 |
|
|
| 46 |
|
return $this->componentString($component, $attributes); |
| 47 |
|
}, $viewContents); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
protected function parseOpeningTags(string $viewContents, Component $component): string |
| 51 |
|
{ |
|
@@ 50-61 (lines=12) @@
|
| 47 |
|
}, $viewContents); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
protected function parseOpeningTags(string $viewContents, Component $component): string |
| 51 |
|
{ |
| 52 |
|
$prefix = $this->bladeX->getPrefix(); |
| 53 |
|
|
| 54 |
|
$pattern = "/<\s*{$prefix}{$component->tag}(?<attributes>(?:\s+[\w\-:]+=(?:\\\"[^\\\"]+\\\"|\'[^\']+\'|[^\'\\\"=<>]+))*\s*)(?<![\/=\-])>/"; |
| 55 |
|
|
| 56 |
|
return preg_replace_callback($pattern, function (array $matches) use ($component) { |
| 57 |
|
$attributes = $this->getAttributesFromAttributeString($matches['attributes']); |
| 58 |
|
|
| 59 |
|
return $this->componentStartString($component, $attributes); |
| 60 |
|
}, $viewContents); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
protected function parseClosingTags(string $viewContents, Component $component): string |
| 64 |
|
{ |