Welcome Guest, Not a member yet? Register   Sign In
How to instance an exception in the controller
#1

[eluser]jeffersonrpn[/eluser]
To show a error message in the user interface (view) I throw exceptions from the models to controller. But I can't create exceptions in the controller using $this->load->model( 'My_exception' ); because this model don't extends a Model Class, but a Exception Class. Check the constructor method:

Code:
class My_exception extends Exception {

  [...]
  public function __construct( $message, $title, $level ) {
    parent::__construct( $message );
    $this->title = $title;
    $this->level = $level;
  }
  [...]

}

How I can instance a model in the controller that don't extends a Model Class?


Messages In This Thread
How to instance an exception in the controller - by El Forum - 05-22-2008, 05:29 PM
How to instance an exception in the controller - by El Forum - 05-23-2008, 01:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB