PHP Version
8.1
CodeIgniter4 Version
4.4.5
CodeIgniter4 Installation Method
Manual (zip or tar.gz)
Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
No response
What happened?
Having this for example in the Config/Routing.php
public ?string $override404 = 'App\Controllers\Errors\Errors::index';
CI_ENVIRONMENT or ENVIRONMENT must be set to Development
before it looked something like this

having the message into the error page
and in Production mode the message is hidden
but i want in development mode to see the error message there is no way to make this happen besides a closure
i know it can be done with a closure but isn't there any other way to do this, if doing so then what is the point of this.
public ?string $override404 variable it is no use for me now if using closures ?
i think it should pass the message in development mode to the controller that is written in the $override404 variable in the config....
Steps to Reproduce
create a Error controller
change app/Config/Routing.php $override404 variable to the new error controller
Expected Output
in development mode you should see the error message with the error page from the error controller as a parameter
in production mode you should see the error page from the error controller without the message
Anything else?
i have tried public ?string $override404 = App\Controllers\Errors\Errors::index/$1
maybe you should pass an array to this variable as it states in the documentation of the routes
$routes->get('messages/(:segment)', 'Support\Messages::index/$1', ['as' => 'messages']);
PHP Version
8.1
CodeIgniter4 Version
4.4.5
CodeIgniter4 Installation Method
Manual (zip or tar.gz)
Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
No response
What happened?
Having this for example in the Config/Routing.php
CI_ENVIRONMENT or ENVIRONMENT must be set to Development
before it looked something like this
having the message into the error page
and in Production mode the message is hidden
but i want in development mode to see the error message there is no way to make this happen besides a closure
i know it can be done with a closure but isn't there any other way to do this, if doing so then what is the point of this.
public ?string $override404variable it is no use for me now if using closures ?i think it should pass the message in development mode to the controller that is written in the $override404 variable in the config....
Steps to Reproduce
create a Error controller
change
app/Config/Routing.php$override404variable to the new error controllerExpected Output
in development mode you should see the error message with the error page from the error controller as a parameter
in production mode you should see the error page from the error controller without the message
Anything else?
i have tried public ?string $override404 = App\Controllers\Errors\Errors::index/$1
maybe you should pass an array to this variable as it states in the documentation of the routes