ErrorPage
class ErrorPage extends Page (View source)
ErrorPage holds the content for the page of an error response.
Renders the page on each publish action into a static HTML file
within the assets directory, after the naming convention
/assets/error-
Properties
static private | $static_filepath |
Methods
No description
Get a {@link SS_HTTPResponse} to response to a HTTP error code if an {@link ErrorPage} for that code is present. First tries to serve it through the standard SilverStripe request method. Falls back to a static file generated when the user hit's save and publish in the CMS
Ensures that there is always a 404 page by checking if there's an instance of ErrorPage with a 404 and 500 error code. If there is not, one is created when the DB is built.
No description
When an error page is published, create a static HTML page with its content, so the page can be shown even when SilverStripe is not functioning correctly before publishing this page normally.
Write out the published version of the page to the filesystem
No description
Returns an absolute filesystem path to a static error file which is generated through {@link publish()}.
Set the path where static error files are saved through {@link publish()}.
Details
bool
canAddChildren($member = null)
static SS_HTTPResponse
response_for(int $statusCode)
Get a {@link SS_HTTPResponse} to response to a HTTP error code if an {@link ErrorPage} for that code is present. First tries to serve it through the standard SilverStripe request method. Falls back to a static file generated when the user hit's save and publish in the CMS
requireDefaultRecords()
Ensures that there is always a 404 page by checking if there's an instance of ErrorPage with a 404 and 500 error code. If there is not, one is created when the DB is built.
FieldList
getCMSFields()
bool
doPublish()
When an error page is published, create a static HTML page with its content, so the page can be shown even when SilverStripe is not functioning correctly before publishing this page normally.
mixed
writeStaticPage()
Write out the published version of the page to the filesystem
array
fieldLabels(bool $includerelations = true)
static string
get_filepath_for_errorcode(int $statusCode, string $locale = null)
Returns an absolute filesystem path to a static error file which is generated through {@link publish()}.
static
set_static_filepath(string $path)
deprecated
deprecated
Set the path where static error files are saved through {@link publish()}.
Defaults to /assets.
static string
get_static_filepath()
deprecated
deprecated