{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/6135","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/6135/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/6135/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/6135/events","html_url":"https://github.com/cakephp/cakephp/pull/6135","id":63521605,"number":6135,"title":"3.0 Multiple Flash messages","user":{"login":"HavokInspiration","id":5243386,"avatar_url":"https://avatars.githubusercontent.com/u/5243386?v=3","gravatar_id":"","url":"https://api.github.com/users/HavokInspiration","html_url":"https://github.com/HavokInspiration","followers_url":"https://api.github.com/users/HavokInspiration/followers","following_url":"https://api.github.com/users/HavokInspiration/following{/other_user}","gists_url":"https://api.github.com/users/HavokInspiration/gists{/gist_id}","starred_url":"https://api.github.com/users/HavokInspiration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HavokInspiration/subscriptions","organizations_url":"https://api.github.com/users/HavokInspiration/orgs","repos_url":"https://api.github.com/users/HavokInspiration/repos","events_url":"https://api.github.com/users/HavokInspiration/events{/privacy}","received_events_url":"https://api.github.com/users/HavokInspiration/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/component","name":"component","color":"FFFFFF"},{"url":"https://api.github.com/repos/cakephp/cakephp/labels/Enhancement","name":"Enhancement","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/31","html_url":"https://github.com/cakephp/cakephp/milestones/3.1.0","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/31/labels","id":919718,"number":31,"title":"3.1.0","description":"Backwards compatible with 3.0.x. Will require PHP 5.5\r\n\r\n### Specific issues\r\n\r\n* Adding the exception trace to the error view data. #6000 \r\n* Changed the translate behavior to support translation engines. #5958 \r\n* Database connection prefixes, or table prefixes.","creator":{"login":"lorenzo","id":37621,"avatar_url":"https://avatars.githubusercontent.com/u/37621?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenzo","html_url":"https://github.com/lorenzo","followers_url":"https://api.github.com/users/lorenzo/followers","following_url":"https://api.github.com/users/lorenzo/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo/subscriptions","organizations_url":"https://api.github.com/users/lorenzo/orgs","repos_url":"https://api.github.com/users/lorenzo/repos","events_url":"https://api.github.com/users/lorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo/received_events","type":"User","site_admin":false},"open_issues":47,"closed_issues":9,"state":"open","created_at":"2015-01-02T15:38:07Z","updated_at":"2015-03-23T14:25:05Z","due_on":"2015-07-26T04:00:00Z","closed_at":null},"comments":10,"created_at":"2015-03-22T10:55:28Z","updated_at":"2015-03-24T03:02:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cakephp/cakephp/pulls/6135","html_url":"https://github.com/cakephp/cakephp/pull/6135","diff_url":"https://github.com/cakephp/cakephp/pull/6135.diff","patch_url":"https://github.com/cakephp/cakephp/pull/6135.patch"},"body":"Add the ability to the FlashComponent and FlashHelper to set and render multiple flash messages.\r\nI also implementend the ability to enable the stacking at a late state (see the tests).\r\nThe FlashComponent also got 2 new method : ``delete()`` and ``clear()``. \r\n\r\n``delete()`` allows the deletion of flash messages based on index if the stacking ability is enabled and the message if not\r\n``clear()`` allows the deleting of messages based on their types. About this method, I went with the current implementation. I'm not really sure if it's the best, performance wise. Another approach would be to keep a map of indexes to quickly get them and delete them. I'm open to suggestion on this.\r\n\r\nThe ``set()`` and ``__call()`` method now returns the index of the inserted message, or null if stacking is disabled.\r\n\r\nTo enable the stacking, I did not create a specific method, the call to ``config()`` being straightforward enough in my opinion. But I'm not against having a ``enableStacking()`` method.\r\n\r\nIt is also possible to have the stack of messages rendered in a specific element, that can be setup in the FlashHelper configuration.\r\n\r\nMore details on #4619"},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/85318366","html_url":"https://github.com/cakephp/cakephp/pull/6135#issuecomment-85318366","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/6135","id":85318366,"user":{"login":"ADmad","id":142658,"avatar_url":"https://avatars.githubusercontent.com/u/142658?v=3","gravatar_id":"","url":"https://api.github.com/users/ADmad","html_url":"https://github.com/ADmad","followers_url":"https://api.github.com/users/ADmad/followers","following_url":"https://api.github.com/users/ADmad/following{/other_user}","gists_url":"https://api.github.com/users/ADmad/gists{/gist_id}","starred_url":"https://api.github.com/users/ADmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ADmad/subscriptions","organizations_url":"https://api.github.com/users/ADmad/orgs","repos_url":"https://api.github.com/users/ADmad/repos","events_url":"https://api.github.com/users/ADmad/events{/privacy}","received_events_url":"https://api.github.com/users/ADmad/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T03:02:02Z","updated_at":"2015-03-24T03:02:02Z","body":"I too agree with @bcrowe that the FlashComponent (and FlashHelper) should be clean and simple. Those who need more complex features should use their own component/helper."}}