cakephp/cakephp — pull request #3643 by bcrowe (2014-06-05 03:42:34+00:00)
Title: 3.0 - FlashComponent + FlashHelper

In a nutshell, this PR ports the existing flash functionality into a separate Component/Helper -- and is a follow-up to https://github.com/cakephp/cakephp/pull/3409 after digesting the feedback within. In which, I largely agree with @jippi's comment.

* Different from the previous PR: logging stuff, default message string templates, static Session calls were all scratched, etc.
* Ported Session classes' flash handling into this Component/Helper
* Added ability to pass an exception as a flash message
* Condensed positional parameters into `$options` array
* Added `__call` magic method to set flash's element, for verbosity
* Kept the "when element === null" default string template around for the sake of the future of `cake.generic.css`
* Scratched the ability to set string templates, as these are better suited for elements, because after Cake's default output/css these will need to be customized to a CSS framework or a user's specifics needs -- to the point where defining all the HTML/tokens in a string template would become silly.

Up for discussion: FlashComponent's `__call` could look for elements within `Template/Element/Flash` instead of a `flash_` prefix.

With these changes the following can be deprecated/removed:
* Cake\Network:Session::flash()
* Cake\Network:Session::readFlash()
* Cake\Network:Session::deleteFlash()
* Cake\Controller\Component\SessionComponent::setFlash()
* Cake\View\Helper\SessionHelper::flash()