lubna / custom-error-bundle
Symfony bundle to customize and override default error pages (404, 403, 500, 401) with Twig templates and error controller support.
Installs: 228
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
Language:Twig
Type:symfony-bundle
pkg:composer/lubna/custom-error-bundle
Requires
- php: >=7.4
- symfony/framework-bundle: ^5.4 || ^6.0 || ^7.0
- twig/twig: ^2.12 || ^3.0
This package is auto-updated.
Last update: 2025-12-13 13:17:07 UTC
README
Customizable error pages for Symfony 6.2 and 7+
This bundle replaces Symfony’s default error pages (404, 403, 500, etc.) with user-friendly Twig templates.
Features
- Handles 404, 403, 500, 401 and other HTTP errors
- Shows a login prompt for 401 errors
- Custom Twig templates
Installation
Install the bundle via Composer:
composer require lubna/custom-error-bundle
🔧 Configuration
1. Register the bundle
In config/bundles.php:
return [
CustomError\Bundle\CustomErrorBundle::class => ['all' => true],
];
If you want the bundle to be active only in production, you can use:
return [
CustomError\Bundle\CustomErrorBundle::class => ['prod' => true],
];
2. Register the error controller
In config/services.yaml:
services:
CustomError\Bundle\Controller\ErrorController:
tags: ['controller.service_arguments']
Author
Made with ❤️ by Lubna
Feel free to contribute, fork, or open issues.