Skip to content

Commit

Permalink
Update ComponentsService.php
Browse files Browse the repository at this point in the history
Added the ability to pass a full namespace into the sprig tag.
  • Loading branch information
alexmglover authored May 11, 2024
1 parent 6fe35b1 commit 1544ab0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/services/ComponentsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ public function createObject(string $component, array $variables = []): ?Compone
return new SprigPlayground(['variables' => $variables]);
}

if (class_exists($component)) {
return new $component(['variables' => $variables]);
}

$componentClass = self::COMPONENT_NAMESPACE . $component;

if (!class_exists($componentClass)) {
Expand Down

0 comments on commit 1544ab0

Please sign in to comment.