1
1

More than 1 year has passed since last update.

CakePHP4でDebugKitツールバーが404エラーになる解決法

Last updated at Posted at 2022-08-31

はじめに

CakePHP 4.4.3 にアップデートしたところ、いつの間にか DebugKit toolbar が表示されなくなっていました

表示するように対応します

cakephp_debug_kit_404.png

結論

routes.php に DebugKit の指定すれば OK

return static function (RouteBuilder $routes) {
    $routes->scope('/', function (RouteBuilder $builder) {
        $builder->fallbacks();

        if (\Cake\Core\Configure::read('debug')) {
            // サーバーの環境変数 DEBUG = true を指定していれば、DebugKit へのルーティングを追加
            $builder->connect('/{controller}/{action}/*', ['plugin' => 'DebugKit']);
        }
    });
}

バージョン

  • PHP
    • 8.1.0
  • CakePHP
    • 4.4.3
  • DebugKit
    • 4.8.1

確認

表示されるようになりました

cakephp_debug_kit_200.png

確認したブランチ

参考

CakePHP4を試す (AuthenticationプラグインとDebug Kitプラグイン)

Cakebook | Debug Kit - 4.x

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1