Location: PHPKode > projects > ASf MVC > asf-mvc/asmvc/sysfiles/plugins/internal.ASfMVC_ErrorHandler.php
<?php
/***
 * Name:	AlexSnet's framework MVC
 * About:	An MVC application framework for PHP
 * Copyright:	(C) 2008, Sudo me.
 * Author:	Alex Snet, me [at] alexsnet [dot] ru
 * Site:	http://alexsnet.ru/
 ***/

// ------------------------------------------------------------------------

/**
 * ASfMVC_ErrorHandler
 * 
 * The MVC error handler
 *
 * @package		ASfMVC
 * @author		Alex Snet
 */

class ASfMVC_ErrorHandler
{
 	/**
	 * class constructor
	 *
	 * @access	public
	 */
  function __construct() { }
  
	/**
	 * trigger_error
	 *
	 * the error handler method used for all triggerable errors
	 *
	 * @access	public
	 */    
  function trigger_error($errno, $errstr, $errfile, $errline)
  {
    /* get instance of ASMVC object */
    $ASMVC = ASMVC::instance();
    
    /* set error messages */
    $errors['errno'] = $errno;
    $errors['errstr'] = $errstr;
    $errors['errfile'] = $errfile;
    $errors['errline'] = $errline;
    $ASMVC->view->view_vars['errors'] = $errors;
    /* display the error view */
    $ASMVC->view->sysview('error_view');
    /* exit if not a notice */
    if($errno == E_USER_ERROR)
      exit(1);
  }
}

?>
Return current item: ASf MVC