Skip to content

Commit 7d6df60

Browse files
committed
Allow customization of error page
1 parent ce12371 commit 7d6df60

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/WebApp/Application.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ public function getMenu($id = NULL) {
329329
return NULL;
330330
}
331331

332+
public function getErrorPage($httpCode) {
333+
return NULL;
334+
}
335+
332336
/**
333337
* Persist any error message in the database.
334338
*/

src/WebApp/Theme.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ public function hasFeature($name) {
184184
}
185185

186186
public function getErrorPage($htmlCode) {
187-
$name = '\\WebApp\\Error\\ErrorPage';
188-
return new $name($this->app, $htmlCode, 'Error');
187+
$rc = $this->app->getErrorPage($htmlCode);
188+
if ($rc == NULL) $rc = new \WebApp\Error\ErrorPage($this->app, $htmlCode, 'Error');
189+
return $rc;
189190
}
190191
}
191192

0 commit comments

Comments
 (0)