1 <?php
defined('SYSPATH') OR die('No direct access allowed.');
3 * Widget for rendering load errors
5 class Error_Widget
extends widget_Base
{
6 private $message = false;
8 * Takes a widget model instance, and an exception, and tries to render
9 * both in a somewhat user-friendly way.
11 public function __construct($widget_obj, $exception) {
12 $this->model
= $widget_obj;
13 if ($this->model
== false) {
14 $this->model
= new stdclass();
15 $this->model
->name
= 'unknown';
16 $this->model
->instance_id
= 1;
17 $this->model
->friendly_name
= 'Unknown widget';
19 if (empty($exception))
20 $exception = new Exception("Unknown error");
21 $this->exception
= $exception;
23 $this->auto_render
= FALSE;
25 public function index() {
26 require(dirname(__FILE__
).'/view.php');