forked from brockf/hero
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Custom 404 Pages for templates
Had to modify default_routes to include 404_override = 'error/view' Created the Error controller with the view method The view method sets the page title and message to 404 Page Not Found, The page you are looking for could not be found.
- Loading branch information
Showing
6 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | ||
|
||
/* | ||
* Error Module | ||
* | ||
* Displays an error | ||
* | ||
* @author Jose' Vargas | ||
* @copyright Jose' Vargas | ||
* @package Hero Framework | ||
* | ||
*/ | ||
|
||
class Error extends Front_Controller { | ||
function __construct() { | ||
parent::__construct(); | ||
} | ||
|
||
function view () { | ||
$this->output->set_status_header('404'); | ||
$content = array( | ||
'title' => '404 Page Not Found' | ||
,'message' => 'The page you requested was not found.' | ||
); | ||
|
||
// show content | ||
$this->smarty->assign($content); | ||
|
||
return $this->smarty->display('error.thtml'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{extends file="layout.thtml"} | ||
{block name="title"}{$title} - {$smarty.block.parent}{/block} | ||
{block name="content"} | ||
<h1>{$title}</h1> | ||
<p>{$message}</p> | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{extends file="layout.thtml"} | ||
{block name="title"}{$title} - {$smarty.block.parent}{/block} | ||
{block name="content"} | ||
<h1>{$title}</h1> | ||
<p>{$message}</p> | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{extends file="layout.thtml"} | ||
{block name="title"}{$title} - {$smarty.block.parent}{/block} | ||
{block name="content"} | ||
<h1>{$title}</h1> | ||
<p>{$message}</p> | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{extends file="layout.thtml"} | ||
{block name="title"}{$title} - {$smarty.block.parent}{/block} | ||
{block name="content"} | ||
<h1>{$title}</h1> | ||
<p>{$message}</p> | ||
{/block} |