tenkoma / cakephp-apache-error-theme
制作Apache网络服务器风格的错误页面。
0.1
2017-01-21 14:37 UTC
Requires
- cakephp/cakephp: ^3.3
This package is not auto-updated.
Last update: 2024-09-23 16:36:55 UTC
README
制作Apache网络服务器风格的错误页面。
安装
您可以使用 composer 进行安装。
composer require tenkoma/cakephp-apache-error-theme
启用插件
您可以使用shell命令加载插件
bin/cake plugin load CakeApacheErrorTheme
或者,您可以在应用程序的 config/bootstrap.php 文件中手动添加加载语句
// config/bootstrap.php Plugin::load('CakeApacheErrorTheme');
启用主题
在 ErrorController::beforeRender()
中设置主题。
// src/Controller/ErrorController.php public function beforeRender(Event $event) { parent::beforeRender($event); $this->viewBuilder()->theme('CakeApacheErrorTheme'); }
并且在 config/app.php
中设置 debug = false
// config/app.php 'debug' => false,
配置
// config/bootstrap.php Configure::write('CakeApacheErrorTheme', [ 'signature' => 'cake', 'email' => 'webmaster@example.com', ]);
签名
apache
(默认)cake
显示 CakePHP 及其版本作为签名。
email
(默认=webmaster@localhost
)在 5xx 错误时显示的电子邮件地址