Files
Woles-Framework/app/Modules/Error/Controller.php
mwpn 0b42271bfe feat: Complete Woles Framework v1.0 with enterprise-grade UI
- Add comprehensive error handling system with custom error pages
- Implement professional enterprise-style design with Tailwind CSS
- Create modular HMVC architecture with clean separation of concerns
- Add security features: CSRF protection, XSS filtering, Argon2ID hashing
- Include CLI tools for development workflow
- Add error reporting dashboard with system monitoring
- Implement responsive design with consistent slate color scheme
- Replace all emoji icons with professional SVG icons
- Add comprehensive test suite with PHPUnit
- Include database migrations and seeders
- Add proper exception handling with fallback pages
- Implement template engine with custom syntax support
- Add helper functions and facades for clean code
- Include proper logging and debugging capabilities
2025-10-11 07:08:23 +07:00

80 lines
1.9 KiB
PHP

<?php
namespace App\Modules\Error;
use App\Core\Controller as BaseController;
class Controller extends BaseController
{
/**
* 404 Not Found page
*/
public function notFound()
{
return $this->view('Error.view.404', [
'title' => '404 - Page Not Found',
'message' => 'The page you are looking for could not be found.',
'code' => 404
], 404);
}
/**
* 500 Internal Server Error page
*/
public function serverError($exception = null)
{
return $this->view('Error.view.500', [
'title' => '500 - Server Error',
'message' => 'Something went wrong on our end.',
'code' => 500,
'exception' => $exception
], 500);
}
/**
* 403 Forbidden page
*/
public function forbidden()
{
return $this->view('Error.view.403', [
'title' => '403 - Forbidden',
'message' => 'You do not have permission to access this resource.',
'code' => 403
], 403);
}
/**
* 401 Unauthorized page
*/
public function unauthorized()
{
return $this->view('Error.view.401', [
'title' => '401 - Unauthorized',
'message' => 'You need to be authenticated to access this resource.',
'code' => 401
], 401);
}
/**
* 419 CSRF Token Mismatch
*/
public function csrfMismatch()
{
return $this->view('Error.view.419', [
'title' => '419 - CSRF Token Mismatch',
'message' => 'Your session has expired. Please try again.',
'code' => 419
], 419);
}
/**
* Error Reports page
*/
public function reports()
{
return $this->view('Error.view.reports', [
'title' => 'Error Reports - Woles Framework'
]);
}
}