Skip to content

Commit

Permalink
Merge pull request #5 from tafid/fix_additioanl_page_logic
Browse files Browse the repository at this point in the history
Fix additional page render, check if file exists
  • Loading branch information
tafid committed Mar 26, 2021
2 parents 265cbd9 + 1f4ae94 commit 2c2f85a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/AdditionalPage.php
Expand Up @@ -69,6 +69,10 @@ public function getLabel(): string
*/
public function render(array $params = []): string
{
return Yii::$app->view->renderFile($this->pathToPage, array_merge($this->params, $params));
if (is_file($this->pathToPage)) {
return Yii::$app->view->renderFile($this->pathToPage, array_merge($this->params, $params));
}

return '';
}
}

0 comments on commit 2c2f85a

Please sign in to comment.