Skip to content

Commit

Permalink
Template::render() snippetDriver is initialized sooner
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jun 25, 2016
1 parent 232f0a1 commit ead1f85
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Latte/Runtime/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ public function render()
if ($this->parentName === NULL && isset($this->global->coreParentFinder)) {
$this->parentName = call_user_func($this->global->coreParentFinder, $this);
}
if (isset($this->global->snippetBridge) && !isset($this->global->snippetDriver)) {
$this->global->snippetDriver = new SnippetDriver($this->global->snippetBridge);
}
Filters::$xhtml = (bool) preg_match('#xml|xhtml#', $this->contentType);

if ($this->referenceType === 'import') {
if ($this->parentName) {
Expand All @@ -179,11 +183,8 @@ public function render()
$this->renderBlock($this->params['_renderblock'], $this->params);
return;
}
} elseif (isset($this->global->snippetBridge) && !isset($this->global->snippetDriver)) {
$this->global->snippetDriver = new SnippetDriver($this->global->snippetBridge);
}

Filters::$xhtml = (bool) preg_match('#xml|xhtml#', $this->contentType);
// old accumulators for back compatibility
$this->params['_l'] = new \stdClass;
$this->params['_g'] = $this->global;
Expand Down

0 comments on commit ead1f85

Please sign in to comment.