|
@@ -51,7 +51,7 @@ discard block |
|
|
block discarded – undo |
|
51
|
51
|
|
|
52
|
52
|
if (!empty($statements)) { |
|
53
|
53
|
$content = sprintf('(function(){var elem = document.querySelector(\'[data-wc="%s"]\');%s}());if(document.currentScript)document.currentScript.parentNode.removeChild(document.currentScript);', $id, join('', $statements)); |
|
54
|
|
- $this->scriptBlock($content, [ 'block' => 'scriptsComponents' ]); |
|
|
54
|
+ $this->scriptBlock($content, ['block' => 'scriptsComponents']); |
|
55
|
55
|
} |
|
56
|
56
|
|
|
57
|
57
|
return trim(sprintf('data-wc="%s" %s', $id, join(' ', $attributes))); |
|
@@ -68,7 +68,7 @@ discard block |
|
|
block discarded – undo |
|
68
|
68
|
public function is(string $tagName, array $properties = [], string $scriptPath = ''): string |
|
69
|
69
|
{ |
|
70
|
70
|
if (!empty($scriptPath)) { |
|
71
|
|
- $this->script($scriptPath, [ 'block' => 'scriptsComponents' ]); |
|
|
71
|
+ $this->script($scriptPath, ['block' => 'scriptsComponents']); |
|
72
|
72
|
} |
|
73
|
73
|
|
|
74
|
74
|
return trim(sprintf('is="%s" %s', $tagName, $this->props($properties))); |
|
@@ -85,7 +85,7 @@ discard block |
|
|
block discarded – undo |
|
85
|
85
|
public function element(string $tagName, array $properties = [], $scriptPath = ''): string |
|
86
|
86
|
{ |
|
87
|
87
|
if (!empty($scriptPath)) { |
|
88
|
|
- $this->script($scriptPath, [ 'block' => 'scriptsComponents' ]); |
|
|
88
|
+ $this->script($scriptPath, ['block' => 'scriptsComponents']); |
|
89
|
89
|
} |
|
90
|
90
|
|
|
91
|
91
|
return trim(sprintf('<%s %s></%s>', $tagName, $this->props($properties), $tagName)); |