X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/f7df1f0ee10189a0d00a814003bd1f242049775d..a2a6a5f4d1500867db74046d8937f63ad3a7e82f:/lib/MECON/HTML/Page.php?ds=sidebyside diff --git a/lib/MECON/HTML/Page.php b/lib/MECON/HTML/Page.php index b0e8429..e43ba41 100644 --- a/lib/MECON/HTML/Page.php +++ b/lib/MECON/HTML/Page.php @@ -40,7 +40,7 @@ class MECON_HTML_Page extends HTML_Page { * @return void * @access public */ - function MECON_HTML_Page() // ~X2C + function MECON_HTML_Page() { parent::HTML_Page( array ( @@ -74,15 +74,38 @@ class MECON_HTML_Page extends HTML_Page { } /** - * Muestra un error a través y termina el programa. + * Muestra un error y termina el programa. */ - function error($msg) + function exitError($msg) { require_once 'MECON/HTML/Error.php'; + if (is_a($msg, 'pear_error')) { + $msg = $msg->getMessage(); + } $this->addBodyContent(new MECON_HTML_Error($msg)); $this->display(); exit; } + /** + * Muestra una variable para debug. + */ + function dump($var, $exit = false) + { + if (!isset($this->_dump)) { + require_once 'Var_Dump.php'; + $this->_dump = new Var_Dump( + array('displayMode' => VAR_DUMP_DISPLAY_MODE_HTML_TABLE)); + } + $this->addBodyContent('
'); + $this->addBodyContent($this->_dump->r_display($var)); + $this->addBodyContent(''); + if ($exit) { + $this->display(); + exit; + } + } + } + ?> \ No newline at end of file