Skip to content

Commit

Permalink
make showtemplate() second param optional
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-peugnet committed Sep 30, 2024
1 parent 6b744d4 commit b0903fe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/class/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function initplates()
$this->plates->addData(['flashmessages' => Model::getflashmessages()]);
}

public function showtemplate($template, $params)
public function showtemplate(string $template, array $params = [])
{
$params = array_merge($this->commonsparams(), $params);
echo $this->plates->render($template, $params);
Expand Down
2 changes: 1 addition & 1 deletion app/class/Controlleradmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct($router)
}
if (!$this->user->isadmin()) {
http_response_code(403);
$this->showtemplate('forbidden', []);
$this->showtemplate('forbidden');
exit;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/class/Controllermedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function desktop()
{
if (!$this->user->iseditor()) {
http_response_code(403);
$this->showtemplate('forbidden', []);
$this->showtemplate('forbidden');
exit;
}
try {
Expand Down
4 changes: 2 additions & 2 deletions app/class/Controlleruser.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function desktop()
$this->showtemplate('user', $datas);
} else {
http_response_code(403);
$this->showtemplate('forbidden', []);
$this->showtemplate('forbidden');
}
}

Expand Down Expand Up @@ -79,7 +79,7 @@ public function update()
}
} else {
http_response_code(403);
$this->showtemplate('forbidden', []);
$this->showtemplate('forbidden');
exit;
}
}
Expand Down

0 comments on commit b0903fe

Please sign in to comment.