This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
lnapp/classes/lnApp/HTTP/Exception.php

40 lines
1.2 KiB
PHP
Raw Normal View History

2013-05-09 14:40:31 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class overrides Kohana's HTTP Exception
*
2013-10-08 23:24:11 +00:00
* @package lnApp
* @category Modifications
2013-05-09 14:40:31 +00:00
* @author Deon George
2014-09-29 04:47:51 +00:00
* @copyright (c) 2009-2013 Deon George
2013-05-09 14:40:31 +00:00
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_HTTP_Exception extends Kohana_HTTP_Exception {
public function get_response() {
Style::factory()
->type('file')
->data('media/css/pages/error.css');
$output = '<div class="container"><div class="row"><div class="error-container">';
$output .= View::factory('errors/'.$this->_code)
->set('message',$this->getMessage());
$output .= '<div class="error-actions">';
2014-09-29 04:47:51 +00:00
$output .= HTML::anchor(((array_key_exists('auth',Kohana::modules()) AND URL::admin_url()) ? 'u/' : '').'welcome','<i class="fa fa-chevron-left"></i> Back to Home',array('class'=>'btn btn-large btn-primary'));
2013-05-09 14:40:31 +00:00
$output .= '</div>';
$output .= '</div></div></div>';
2014-08-22 06:50:01 +00:00
$view = View::factory(Site::Theme().'/page')
2013-05-09 14:40:31 +00:00
->set('meta',new Meta)
->set('navbar','')
->set('content',$output);
return Response::factory()
->status($this->_code)
->body($view);
return $response;
}
}
?>