4 * Error controller is here to display critical errors to the user when system is unable to serve
5 * users requests (failed to connect to database, unknown controller etc)
8 * @http://www.projectpier.org/
10 class ErrorController
extends PageController
{
13 * Construct the ErrorController
17 * @return ErrorController
19 function __construct() {
20 parent
::__construct();
21 $this->addHelper('form', 'breadcrumbs', 'pageactions', 'tabbednavigation', 'company_website', 'project_website');
25 * Show system error message
31 $this->showError('system error message');
35 * This error is shown when we fail to execute action - controller dnx, action is not defined or something like that
40 function execute_action() {
41 $this->showError('execute action error message');
45 * This message is shown when we fail to connect to the database. This template does not use language
46 * files because localization resources are not available at the moment we are connecting to the database.
51 function db_connect() {
61 private function showError($message_lang_code) {
62 tpl_assign('error_message', $message_lang_code);
63 $this->setTemplate('error_message');