src/Controller/Component/FlashAndRedirectTrait.php
protected function _handleFlash($type, $options) {
		if (isset($options[$type . 'Message']) && $options[$type . 'Message'] !== false) {
			if (is_string($options[$type . 'Message'])) {
				$flashOptions = [];
				if (isset($options[$type . 'FlashOptions'])) {
					$flashOptions = $options[$type . 'FlashOptions'];
				}

				if (!isset($flashOptions['element'])) {
					if (!$this->_registry->has('Flash')) {
						$this->_registry->load('Flash');
					}

					$flashOptions['element'] = $type;
					$this->_registry->get('Flash')->set($options[$type . 'Message'], $flashOptions);
				}

				return true;
			}
		}

		return false;
	}
protected function _handleFlash($type, $options) {
		if (isset($options[$type . 'Message']) && $options[$type . 'Message'] !== false) {
			if (is_string($options[$type . 'Message'])) {
				$flashOptions = [];
				if (isset($options[$type . 'FlashOptions'])) {
					$flashOptions = $options[$type . 'FlashOptions'];
				}

				if (!isset($flashOptions['element'])) {
					if (!$this->_registry->has('Flash')) {
						$this->_registry->load('Flash');
					}

					$flashOptions['element'] = $type;
					$this->_registry->get('Flash')->set($options[$type . 'Message'], $flashOptions);
				}

				return true;
			}
		}

		return false;
	}
protected function _handleFlash ( $ type , $ options ) { if ( isset ( $ options [ $ type . 'Message' ] ) && $ options [ $ type . 'Message' ] !== false ) { if ( is_string ( $ options [ $ type . 'Message' ] ) ) { $ flashOptions = [ ] ; if ( isset ( $ options [ $ type . 'FlashOptions' ] ) ) { $ flashOptions = $ options [ $ type . 'FlashOptions' ] ; } if ( ! isset ( $ flashOptions [ 'element' ] ) ) { if ( ! $ this -> _registry -> has ( 'Flash' ) ) { $ this -> _registry -> load ( 'Flash' ) ; } $ flashOptions [ 'element' ] = $ type ; $ this -> _registry -> get ( 'Flash' ) -> set ( $ options [ $ type . 'Message' ] , $ flashOptions ) ; } return true ; } } return false ; }
Handles the flash options.

@param string $type Prefix for the array key, mostly "success" or "error"
@param array $options Options
@return bool
Handles the flash options .