Debug Output and Flash Messages
The documentation is constantly evolving and updated alongside the project's progress. Since it is developed in parallel with the code, some sections may temporarily refer to earlier versions of the system-these are gradually adapted to the current state of the application. If you notice any outdated information, please report it or open an Issue / Pull Request.
Documentation
# Debug Output and Flash Messages
# dump() in DBM Platform
dump() is a global helper declared by bootstrap/support.php, which the platform public entry point loads after autoloading. It delegates to Dbm\Support\Helpers\DebugHelper and renders a formatted HTML dump.
dump($user);
This is a development diagnostic, not a response helper. DebugHelper::dump() ends execution with exit, so code after the call will not run and only the first value passed to the variadic global helper will be displayed. Do not leave it in production request paths or expose it where the output could disclose secrets. The framework class can be used directly, but it also terminates execution.
# FlashBag in controllers
There is no global flash() function in the current framework/platform source. Controllers use Dbm\Views\Flash\FlashBag, which stores one-time messages through SessionManager:
$this->flash->set('Profile saved.', 'messageSuccess');
Supported types are messageInfo, messageWarning, messageDanger, and messageSuccess. Unknown types fall back to messageInfo. The session must be started by the middleware pipeline or explicitly before session-backed operations.
# Read a flash message in a template
ViewServiceProvider registers a flash callback as a template global. TemplateFeature::getFlash() calls that callback and returns one message as ['type' => ..., 'message' => ...], consuming it from the session:
{% $notice = $this->getFlash(); %}
{% if ($notice): %}
<div class="{{ Dbm\Views\Flash\FlashBag::cssClass($notice['type']) }}">
{{ $notice['message'] }}
</div>
{% endif %}
The return value is a message record, not a string. Flash output should remain escaped by the template compiler. It is intended for transient UI feedback after redirects, not durable notifications.