Skip to content

Commit

Permalink
Nesting fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
devtronic committed Jun 16, 2018
1 parent 18a8278 commit ba49744
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/ComposeEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,25 @@ private function getTemplatesForAutoCompose($templateName)

public function loadTemplate($name, $index = null)
{
if (!is_array($name) && !is_object($name) && isset($this->loadingTemplates[$name])) {
return $this->loadingTemplates[$name];
if (isset($this->loadingTemplates[$name])) {
return parent::loadTemplate($name, $index);
}

if ($this->autoCompose) {
$this->loadingTemplates[$name] = false;
}
$this->preLoadTemplate($name);
$template = parent::loadTemplate($name, $index);
$template = $this->postLoadTemplate($name, $template);
return $template;
}

public function preLoadTemplate($name)
{
if ($this->autoCompose == false) {
return;
}
$this->loadingTemplates[$name] = null;

}

public function postLoadTemplate($name, $template)
{
if ($this->autoCompose == false) {
return $template;
}

$this->loadingTemplates[$name] = $template;
$this->loadingTemplates[$name] = true;
return self::doCompose($this, $template, $this->getTemplatesForAutoCompose($name));
}

Expand Down

0 comments on commit ba49744

Please sign in to comment.