What is the Debug Toolbar in CodeIgniter 4?
Answer
The Debug Toolbar in CI4 is a development tool that appears at the bottom of the page showing detailed performance information. It displays: timeline (how long each part of the request took), database queries (all queries executed, their bindings, and execution time), files loaded, session data, request data (GET, POST, COOKIES, headers), response info, log messages, and routes information. Enable in the .env file: CI_ENVIRONMENT = development. The toolbar automatically appears in development mode. It integrates with CI4's Events system. The Timeline tab is particularly useful for identifying slow parts of the request. The Database tab helps identify N+1 query problems. You can add custom timing markers to the timeline: $this->startTimer("name"); ... $this->stopTimer("name").