{"id":20103150,"url":"https://github.com/dotkernel/dot-flashmessenger","last_synced_at":"2025-08-12T18:17:57.605Z","repository":{"id":11252313,"uuid":"67817098","full_name":"dotkernel/dot-flashmessenger","owner":"dotkernel","description":"Flash messenger library for session messages between redirects","archived":false,"fork":false,"pushed_at":"2025-03-12T08:16:17.000Z","size":128,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"3.0","last_synced_at":"2025-07-24T07:42:41.036Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.dotkernel.org/dot-flashmessenger/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotkernel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-09-09T17:04:55.000Z","updated_at":"2025-03-12T08:11:21.000Z","dependencies_parsed_at":"2024-06-21T20:20:37.296Z","dependency_job_id":"68491c32-045a-4cfc-bd27-1745629d0154","html_url":"https://github.com/dotkernel/dot-flashmessenger","commit_stats":{"total_commits":41,"total_committers":9,"mean_commits":4.555555555555555,"dds":0.4878048780487805,"last_synced_commit":"78b1aab7fa2a77e1b9dcd08251e0fd88693195f5"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/dotkernel/dot-flashmessenger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotkernel%2Fdot-flashmessenger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotkernel%2Fdot-flashmessenger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotkernel%2Fdot-flashmessenger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotkernel%2Fdot-flashmessenger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotkernel","download_url":"https://codeload.github.com/dotkernel/dot-flashmessenger/tar.gz/refs/heads/3.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotkernel%2Fdot-flashmessenger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270111017,"owners_count":24529193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T17:34:27.987Z","updated_at":"2025-08-12T18:17:57.302Z","avatar_url":"https://github.com/dotkernel.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dot-flashmessenger\n\nFlash messenger library for session messages between redirects.\nA flash message, or session message is a piece of text data that survives one requests(available only in the next request).\nThis library accepts session data as well, not just string messages, with the same behaviour.\nThe flash messenger is a convenient way to add data to the session and get it back on the next request without bothering with setting and clearing the data manually.\n\n## Documentation\n\nDocumentation is available at: https://docs.dotkernel.org/dot-flashmessenger/.\n\n## Badges\n\n![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-flashmessenger)\n![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-flashmessenger/3.6.0)\n\n[![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-flashmessenger)](https://github.com/dotkernel/dot-flashmessenger/issues)\n[![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-flashmessenger)](https://github.com/dotkernel/dot-flashmessenger/network)\n[![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-flashmessenger)](https://github.com/dotkernel/dot-flashmessenger/stargazers)\n[![GitHub license](https://img.shields.io/github/license/dotkernel/dot-flashmessenger)](https://github.com/dotkernel/dot-flashmessenger/blob/3.0/LICENSE.md)\n\n[![Build Static](https://github.com/dotkernel/dot-flashmessenger/actions/workflows/continuous-integration.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-flashmessenger/actions/workflows/continuous-integration.yml)\n[![codecov](https://codecov.io/gh/dotkernel/dot-flashmessenger/graph/badge.svg?token=B4WAT3RYKJ)](https://codecov.io/gh/dotkernel/dot-flashmessenger)\n[![PHPStan](https://github.com/dotkernel/dot-flashmessenger/actions/workflows/static-analysis.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-flashmessenger/actions/workflows/static-analysis.yml)\n\n## Installation\n\nRun the following command in your project folder\n\n```shell\ncomposer require dotkernel/dot-flashmessenger\n```\n\nThis will also install `laminas/laminas-session` as session handling is based on this library.\nNext, merge the `ConfigProvider` to your application's configuration\n\n## Configuration\n\n```php\nreturn [\n    'dot_flashmessenger' =\u003e [\n        'namespace' =\u003e 'flash messages session namespace name'\n    ],\n];\n```\n\nSets the session namespace to use for all flash messages and data\n\n## Usage\n\nIf following the installation step, you'll already have a FlashMessenger service in the service manager.\nJust inject this service in you classes, wherever you need flash messages.\n\n### Getting the service in a factory\n\n```php\n$container-\u003eget(FlashMessengerInterface::class);\n```\n\n### Using the flash messenger service\n\nTo add and retrieve text messages\n\n```php\n$this-\u003eflashMessenger-\u003eaddMessage('error', 'This is a error flash message');\n//on the next request you can get all messages from a namespace, or all messages from all namespaces if namespace is omitted\n$this-\u003eflashMessenger-\u003egetMessages('error');\n```\n\nAdding general data, not just messages, has a different method for that, accepting data as key/value pairs\n\n```php\n$this-\u003eflashMessenger-\u003eaddData('myData', $someData);\n// next request\n$this-\u003eflashMessenger-\u003egetData('myData');\n```\n\nThere are also some predefined namespaces, along with shortcuts to add a message in the predefined namespaces\n\n```php\nFlashMessengerInterface::ERROR_NAMESPACE\nFlashMessengerInterface::WARNING_NAMESPACE \nFlashMessengerInterface::INFO_NAMESPACE \nFlashMessengerInterface::SUCCESS_NAMESPACE\n```\n\nusing the methods:\n\n```php\n/**\n * @param string $error\n * @return void\n */\npublic function addError($error);\n\n/**\n * @param string $info\n * @return void\n */\npublic function addInfo($info);\n\n/**\n * @param string $warning\n * @return void\n */\npublic function addWarning($warning);\n\n/**\n * @param string $success\n * @return void\n */\npublic function addSuccess($success);\n```\n\n## FlashMessengerRenderer\n\nA class that is able to parse the content of the flash messenger service in an HTML format.\nIt uses the TemplateInterface to parse a partial, sending to the partial template the messages, the service and the renderer itself.\nThere are also a twig extension provided in [dot-twigrenderer](https://github.com/dotkernel/dot-twigrenderer), for easy parsing of messages blocks.\n\n## Registered services\n\n```php\nDot\\FlashMessenger\\FlashMessengerInterface::class\n```\n\nThe flash messenger service\n\n```php\nDot\\FlashMessenger\\View\\RendererInterface::class\n```\n\nThe registered renderer class\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotkernel%2Fdot-flashmessenger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotkernel%2Fdot-flashmessenger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotkernel%2Fdot-flashmessenger/lists"}