Skip to content

Commit

Permalink
Remove unnecessary loadPartial method
Browse files Browse the repository at this point in the history
  • Loading branch information
theodorejb committed Dec 11, 2024
1 parent b36fd43 commit 8fc9b70
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions src/Handlebars/Handlebars.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class Handlebars

private Helpers $helpers;

private array $aliases = [];

/**
* @var bool Enable @data variables
*/
Expand Down Expand Up @@ -170,18 +168,6 @@ public function loadTemplate(string $source): Template
return new Template($this, $tree, $source);
}

/**
* Load a partial by name with current partial loader
*/
public function loadPartial(string $name): Template
{
if (isset($this->aliases[$name])) {
$name = $this->aliases[$name];
}
$tree = $this->tokenize($name);
return new Template($this, $tree, $name);
}

/**
* Try to tokenize source, or get them from cache if available
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Handlebars/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ private function inverted(Context $context, array $current): string
*/
private function partial(Context $context, array $current): string
{
$partial = $this->handlebars->loadPartial($current[Tokenizer::NAME]);
$partial = $this->handlebars->loadTemplate($current[Tokenizer::NAME]);

if ($current[Tokenizer::ARGS]) {
$context = $context->get($current[Tokenizer::ARGS]);
Expand Down

0 comments on commit 8fc9b70

Please sign in to comment.