Message
API reference › Debug › exception › Message
Defines exception message templates used by the Yii debug adapter.
Use Message::getMessage() to format a template with sprintf() arguments.
| Case | Value | Description |
|---|---|---|
ACCESS_DENIED | 'You are not allowed to access this page.' | Access to the requested debug page is denied. |
ACCESS_DENIED_BY_CALLBACK | 'Access to debugger is denied due to checkAccessCallback.' | Access to the debugger is denied by the configured callback. |
ACTIVE_SESSION_REQUIRED | 'Need an active session' | An active session is required. |
CAPTURED_MAIL_FILE_MODE_FAILED | 'Unable to apply mode to captured mail file: %s' | The mode cannot be applied to a captured mail file. |
CAPTURED_MAIL_FILE_NAME_INVALID | 'Invalid captured mail file name: %s' | A captured mail file name is invalid. |
CAPTURED_MAIL_FILE_PERSIST_FAILED | 'Unable to persist captured mail file: %s' | A captured mail file cannot be persisted. |
COLLECTOR_CLASS_INVALID | 'Debug collector configuration must declare a valid class name.' | The collector configuration lacks a valid class name. |
COLLECTOR_ENABLED_INVALID | "Debug collector '%s' must declare 'enabled' as a boolean." | A collector entry declares a non-boolean enabled flag. |
COLLECTOR_INTERFACE_INVALID | 'Debug collector class must implement %s: %s.' | The configured collector does not implement the required interface. |
COLLECTORS_NOT_INITIALIZED | 'Debug collectors have not been initialized.' | The debug collectors have not been initialized. |
CSRF_VALIDATION_FAILED | 'Unable to verify your data submission.' | CSRF validation has failed. |
DB_COMPONENT_INVALID | "Application component '%s' must be a DB connection." | An application component is not a database connection. |
DEBUG_ACTION_MODULE_INVALID | 'Debug actions must be dispatched through the debug module.' | A debug action is dispatched through an incompatible module. |
DEBUG_DATA_EMPTY | 'No debug data have been collected yet, | No debug data have been collected. |
DEBUG_DATA_NOT_FOUND | "Unable to find debug data tagged with '%s'." | Debug data cannot be found for a tag. |
DEBUG_DATA_SUMMARY_MISSING | "Debug data tagged with '%s' does not contain summary data." | Tagged debug data omit the summary payload. |
DEBUG_DATA_SUMMARY_UNAVAILABLE | "Debug data tagged with '%s' has no summary." | A summary is unavailable for tagged debug data. |
DEBUG_PANEL_NOT_FOUND | "Debug panel '%s' not found." | A requested debug panel cannot be found. |
DEBUG_TAG_NOT_FOUND | 'Debug tag not found.' | The requested capture tag cannot be resolved. |
DISPATCHER_COLLECTOR_NOT_DISPATCHER | "Debug collector '%s' must implement %s to be handed to a component as its dispatcher." | A dispatchers entry names a collector that cannot act as a PSR-14 dispatcher. |
DISPATCHER_COLLECTOR_UNKNOWN | "Debug dispatcher '%s' names no configured collector." | A dispatchers entry names a collector that is neither registered nor disabled. |
DISPATCHER_COMPONENT_INSTANTIATED | "Application component '%s' is already instantiated and exposes no writable 'eventDispatcher' property." | A dispatchers entry targets a component that is already built and has no writable dispatcher property. |
DISPATCHER_COMPONENT_UNKNOWN | "Debug dispatcher '%s' targets the unknown application component '%s'." | A dispatchers entry targets a component the application does not declare. |
DISPATCHER_TARGET_UNSUPPORTED | "Application component '%s' must be a class name or configuration array declaring an 'eventDispatcher' " . 'property or constructor parameter.' | A dispatchers entry targets a component definition that cannot take the collector. |
IDENTITY_CLASS_NOT_CONFIGURED | 'User component is not configured with an identity class.' | The user component lacks an identity class. |
IDENTITY_NOT_FOUND | 'Identity not found.' | The requested identity cannot be found. |
IDENTITY_REQUIRED_FOR_SWITCH | 'Cannot switch to a user without an attached identity.' | User switching requires an attached identity. |
LOG_MESSAGE_NOT_FOUND | 'Log message not found.' | A requested log message cannot be found. |
LOG_TARGET_CLASS_INVALID | 'Debug module logTarget configuration must declare a valid class name.' | The log target configuration lacks a valid class name. |
LOG_TARGET_INSTANCE_INVALID | 'Debug module logTarget must resolve to a yii\ | The configured log target resolves to an incompatible instance. |
LOG_TARGET_NOT_BOOTSTRAPPED | 'Debug module logTarget has not been bootstrapped; call Module::bootstrap() first.' | The debug module log target has not been bootstrapped. |
LOG_TARGET_NOT_INITIALIZED_FOR_LOADING | 'The debug module logTarget must be initialized before loading debug data.' | The log target is unavailable for loading debug data. |
LOG_TARGET_NOT_INITIALIZED_FOR_READING | 'The debug module logTarget must be initialized before reading log messages.' | The log target is unavailable for reading log messages. |
MAIL_COLLECTOR_NOT_FOUND | 'Mail collector not found.' | The mail collector cannot be found. |
MAIL_FILE_NOT_FOUND | 'Mail file not found' | A requested captured mail file cannot be found. |
PANEL_CLASS_INVALID | "Debug panel '%s' configuration must declare a valid class name." | A panel configuration lacks a resolvable class name. |
PANEL_ID_DUPLICATE | 'Duplicate debug panel ID: %s.' | A registration ID is declared twice. |
PANEL_INSTANCE_INVALID | "Debug panel '%s' must resolve to a %s instance: %s." | A panel configuration resolves to an object outside the panel contract. |
PANEL_METADATA_OVERRIDE_UNSUPPORTED | "Debug panel '%s' registration options 'title' and 'icon' apply to portable panels only." | A title or icon override targets a panel that renders its own metadata. |
PANEL_PAYLOAD_EXPECTED | 'a payload supported by this panel' | A panel receives an unsupported hydration payload. |
PANELS_NOT_INITIALIZED | 'Debug panels have not been initialized.' | The debug panels have not been initialized. |
PORTABLE_PANEL_NOT_HYDRATED | 'No portable panel capture has been hydrated.' | A portable panel is rendered before any capture was hydrated into it. |
POST_ONLY | 'Only POST requests are allowed.' | The request must use the POST method. |
PROVIDER_ID_MISMATCH | 'The debug %s registration ID must match its provider.' | A configured registration ID does not match the provider it wraps. |
PROVIDER_PANEL_REQUIRED | 'A declarative debug panel provider must be configured.' | A provider-backed panel is used without its declarative provider. |
QUEUE_JOB_RECORD_NOT_FOUND | 'Queue job record not found.' | A requested queue job record cannot be found. |
REQUIRED_SERVICE_NOT_FOUND | 'Could not load required service: %s' | Yii cannot resolve a required action service. |
SEARCH_MODEL_REQUIRED | '%s::$searchModel must be set.' | A filter banner lacks its required search model. |
SERVICE_INSTANCE_INVALID | 'Debug module service must resolve to a %s instance.' | A module service definition resolves to an object outside the service contract. |
SHELL_CONTEXT_REQUIRED | 'The debug layout requires a ShellContext.' | The debug layout lacks its required shell context. |
TOOLBAR_ENVELOPE_INVALID | "Debug panel '%s' returned an invalid toolbar envelope: '%s'." | A panel toolbar envelope breaks the typed toolbar contract. |
USER_COMPONENT_INVALID | "Application component '%s' must be a 'yii\ | An application component is not a Yii web user instance. |
USER_FILTER_MODEL_INVALID | 'User filter model must implement %s.' | The user filter model does not implement the required interface. |
USER_ID_INVALID | 'Invalid user_id parameter.' | A supplied user identifier is invalid. |
USER_SWITCH_MODULE_REQUIRED | 'Unable to configure user switching without a debug module.' | User switching cannot be configured without a debug module. |
YII_LOGO_UNREADABLE | 'Unable to read the packaged Yii logo.' | The packaged Yii logo cannot be read. |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getMessage() | Formats the message template with the supplied arguments. | Message |
Method details
Section titled “Method details”getMessage()
Section titled “getMessage() ”public function getMessage(int|string ...$argument): stringFormats the message template with the supplied arguments.
Parameters
| Parameter | Type | Description |
|---|---|---|
...$argument | int| | Values inserted into the template. |
Returns
string: Formatted exception message.