HTML and CSS Reference
In-Depth Information
public function get_title( )
return 'Something went wrong.';
* Loads and outputs the view's markup
* @return void
public function output_view( )
$view = new View('error');
$view->message = $this->_message;
$view->home_link = APP_URI;
The Error class is a little different in that it declares a private property $_message that will store the Exception
class' error message.
The constructor stores the supplied error message in $_message if one is supplied, and get_title() returns a
generic error message for the <title> tag.
The view() method simply adds the error message and home page URI to the view object for use in the markup;
then renders the output.
Creating the Error View
To display the results of the Error controller, create a new file in system/views/ called and add the
following markup:
<section id="error">
I&rsquo;m sorry, Dave.<br />
I&rsquo;m afraid I can&rsquo;t do that.
Sorry, but something went wrong. Maybe the error message below
will help.
<p><code> <?php echo $message; ?> </code></p>
<a href=" <?php echo $home_link; ?> ">&larr; go back to the home page</a>
Search WWH ::

Custom Search