Skip to content

tenkoma/cakephp-apache-error-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CakePHP Apache error theme plugin

Make error pages Apache web server style.

Not Found

Installation

You can install using composer.

composer require tenkoma/cakephp-apache-error-theme

Enable Plugin

You can load the plugin using the shell command:

bin/cake plugin load CakeApacheErrorTheme

Or you can manually add the loading statement in the config/bootstrap.php file of your application:

// config/bootstrap.php
Plugin::load('CakeApacheErrorTheme');

Enable theme

set theme in the ErrorController::beforeRender().

// src/Controller/ErrorController.php
    public function beforeRender(Event $event)
    {
        parent::beforeRender($event);

        $this->viewBuilder()->theme('CakeApacheErrorTheme');
    }

and debug = false in the config/app.php

// config/app.php
    'debug' => false,

Configure

// config/bootstrap.php
Configure::write('CakeApacheErrorTheme', [
    'signature' => 'cake',
    'email' => '[email protected]',
]);
  • signature
    • apache (default)
    • cake show CakePHP and version as signature.
  • email (default=webmaster@localhost) E-mail address to be displayed at 5xx error

Example

404 Not Found

Not Found

5xx Internal Error

Internal Error

About

Make error pages Apache web server style.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages