Skip to content

Commit

Permalink
fixup! Feat: Normalize template name using regex to allow capitalized…
Browse files Browse the repository at this point in the history
… prefixes
  • Loading branch information
literat committed Jun 12, 2024
1 parent 445fa2f commit 1673375
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Compiler/ComponentTagCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ function (array $matches) {

protected function componentStartString(string $component, string $attributes): string
{
return "{% embed \"@" . $this->twigPathAlias . "/" . $this->normalizeComponentPathName($component) . ".twig\" with { props: $attributes } %}";
return sprintf(
// another `%` is used for escaping the `%`, e. g. `%%` -> `%`
"{%% embed \"@%s/%s.twig\" with { props: %s } %%}",
$this->twigPathAlias,
$this->normalizeComponentPathName($component),
$attributes
);
}

/**
Expand Down

0 comments on commit 1673375

Please sign in to comment.