Permalink
Browse files

Fix parent context assignment

  • Loading branch information...
1 parent 030ad9c commit 863340dc9142c4c73825606373226bb3d3303b6c @saltybeagle saltybeagle committed Nov 14, 2009
Showing with 7 additions and 8 deletions.
  1. +7 −8 src/Templates/Savant/Main.php
@@ -682,17 +682,16 @@ protected function fetch($mixed, $template = null)
}
$this->template = $this->getClassToTemplateMapper()->map($class);
}
- $file = $this->findTemplateFile($this->template);
+ $current = new \stdClass;
+ $current->file = $this->findTemplateFile($this->template);
+ $current->context = $mixed;
+ $current->parent = null;
$outputcontroller = $this->output_controllers[$this->selected_controller];
- $parent = new \stdClass;
if (count($this->templateStack)) {
- $parent->parent = $this->templateStack[count($this->templateStack)-1];
- } else {
- $parent->parent = null;
+ $current->parent = $this->templateStack[count($this->templateStack)-1];
}
- $parent->context = $mixed;
- $this->templateStack[] = $parent;
- $ret = $outputcontroller($mixed, $parent, $file);
+ $this->templateStack[] = $current;
+ $ret = $outputcontroller($current->context, $current->parent, $current->file);
array_pop($this->templateStack);
return $ret;
}

0 comments on commit 863340d

Please sign in to comment.