Skip to content

Commit 2fc2584

Browse files
"Because I have to, not because I want to: Added 404 error controller and view for Spindle CMS."
1 parent 7804097 commit 2fc2584

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/*
3+
* Spindle CMS
4+
* Copyright (c) 2025. All rights reserved.
5+
*
6+
* This file is part of the Spindle CMS project — a lightweight, modular PHP content framework derived from OpenCart.
7+
*
8+
* @license GNU General Public License v3.0 (GPL-3.0-or-later)
9+
* @link https://github.com/RandomCoderTinker/Spindle
10+
*/
11+
12+
namespace Spindle\Shared\Controller\Error;
13+
14+
use Spindle\System\Engine\Controller;
15+
16+
class NotFound extends Controller
17+
{
18+
19+
public function index (): void
20+
{
21+
// Set the header to a 404
22+
$this->response->addHeader('HTTP/1.1 404 Not Found');
23+
24+
// Create the home link
25+
$data['home_link'] = $this->url->link('common/home', target_application: 'app');
26+
27+
$this->response->setOutput($this->load->view('shared/error/not_found', $data));
28+
}
29+
30+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<center>Not found page<br><a href="{{ home_link }}">Home Page</a></center>

0 commit comments

Comments
 (0)