Skip to content

Commit

Permalink
Add support for custom templates
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiz committed Jul 31, 2018
1 parent b751383 commit 9382df5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion phplib/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,17 @@ public static function render($tpl, $vars, $debug_data=[]) {

// Render the template. If there's an error, dump the output buffer.
ob_start();
$template_file_list = [
sprintf('%s/exttemplates/%s.php', BASE_DIR, $tpl),
sprintf('%s/templates/%s.php', BASE_DIR, $tpl),
];
try {
require(sprintf('%s/templates/%s.php', BASE_DIR, $tpl));
foreach($template_file_list as $template_file) {
if(file_exists($template_file)) {
require($template_file);
break;
}
}
} catch(\Exception $e) {
ob_end_clean();
throw $e;
Expand Down

0 comments on commit 9382df5

Please sign in to comment.