Skip to content

Commit

Permalink
Fixes error with casting template name as array to string
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrzejchalubek committed Apr 12, 2017
1 parent 374563a commit 5e30623
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Gin/Template/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public function doActions()
return;
}

// Use first template name, if template
// file is an array, but is not named.
if (is_array($this->file) && isset($this->file[0])) {
return do_action("get_template_part_{$this->file[0]}", $this->file[0], null);
}

do_action("get_template_part_{$this->file}", $this->file, null);
}

Expand Down Expand Up @@ -123,7 +129,7 @@ public function getFilename($extension = '.php')

// Use first template name, if template
// file is an array, but is not named.
if (is_array($this->file)) {
if (is_array($this->file) && isset($this->file[0])) {
return "{$this->file[0]}{$extension}";
}

Expand Down

0 comments on commit 5e30623

Please sign in to comment.