Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

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 11, 2017
1 parent 2ad2950 commit ae7be35
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 @@ -125,7 +131,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 ae7be35

Please sign in to comment.