Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12239590
errorpage.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
errorpage.php
View Options
<?php
/**
* _, __, _, _ __, _ _, _, _
* / \ |_) (_ | | \ | /_\ |\ |
* \ / |_) , ) | |_/ | | | | \|
* ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
*
* Controller for error pages
*
* @package ObsidianWorkspaces
* @subpackage Controllers
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @filesource
*
*/
/**
* Error pages controller
*/
class
ErrorPageController
extends
Controller
{
/**
* @var int The HTTP error code
*/
protected
$errorCode
;
/**
* Shows an error page
*
* @param Context $context The application or site context
* @param $errorCode The HTTP error code
*/
public
static
function
show
(
$context
,
$errorCode
)
{
static
::
load
(
$context
)
->
setErrorCode
(
$errorCode
)
->
handleRequest
();
}
/**
* Sets HTTP error code
*
* @param $errorCode The HTTP error code
* @return ErrorPageController the current instance
*/
public
function
setErrorCode
(
$errorCode
)
{
$this
->
errorCode
=
$errorCode
;
return
$this
;
}
/**
* Handles controller request
*/
public
function
handleRequest
()
{
$smarty
=
$this
->
context
->
templateEngine
;
$smarty
->
assign
(
"URL_HOME"
,
get_url
());
switch
(
$this
->
errorCode
)
{
case
404
:
header
(
"HTTP/1.0 404 Not Found"
);
$smarty
->
display
(
"errors/404.tpl"
);
break
;
default
:
die
(
"Unknown error page: "
.
$this
->
errorCode
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 11, 22:37 (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3064209
Default Alt Text
errorpage.php (1 KB)
Attached To
Mode
rOBSIDIAN Obsidian Workspaces
Attached
Detach File
Event Timeline
Log In to Comment