first import
[projectpier.git] / application / controllers / ErrorController.class.php
blob7ccf42f41b13684af03eff00bfe645335b803627
1 <?php
3 /**
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)
7 * @version 1.0
8 * @http://www.projectpier.org/
9 */
10 class ErrorController extends PageController {
12 /**
13 * Construct the ErrorController
15 * @access public
16 * @param void
17 * @return ErrorController
19 function __construct() {
20 parent::__construct();
21 $this->addHelper('form', 'breadcrumbs', 'pageactions', 'tabbednavigation', 'company_website', 'project_website');
22 } // __construct
24 /**
25 * Show system error message
27 * @param void
28 * @return null
30 function system() {
31 $this->showError('system error message');
32 } // system
34 /**
35 * This error is shown when we fail to execute action - controller dnx, action is not defined or something like that
37 * @param void
38 * @return null
40 function execute_action() {
41 $this->showError('execute action error message');
42 } // execute_action
44 /**
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.
48 * @param void
49 * @return null
51 function db_connect() {
53 } // db_connect
55 /**
56 * Show error
58 * @param void
59 * @return null
61 private function showError($message_lang_code) {
62 tpl_assign('error_message', $message_lang_code);
63 $this->setTemplate('error_message');
64 } // showError
66 } // ErrorController