Skip to content
Permalink
Browse files

Simplify code used to generate plugin flash messages.

  • Loading branch information...
markstory committed Oct 18, 2015
1 parent fd50d19 commit 925647ae2b2a7713f030a6df16e61038e7769678
Showing with 3 additions and 10 deletions.
  1. +3 −10 lib/Cake/Controller/Component/FlashComponent.php
@@ -38,7 +38,6 @@ class FlashComponent extends Component {
'key' => 'flash',
'element' => 'default',
'params' => array(),
'plugin' => '',
);
/**
@@ -77,17 +76,11 @@ public function set($message, $options = array()) {
$message = $message->getMessage();
}
list($plugin, $element) = pluginSplit($options['element']);
if ($plugin) {
$options['plugin'] = $plugin;
}
list($plugin, $element) = pluginSplit($options['element'], true);
if (!empty($options['plugin'])) {
$options['element'] = $options['plugin'] . '.Flash/' . $element;
} else {
$options['element'] = 'Flash/' . $element;
$plugin = $options['plugin'] . '.';
}
$options['element'] = $plugin . 'Flash/' . $element;
CakeSession::write('Message.' . $options['key'], array(
'message' => $message,

0 comments on commit 925647a

Please sign in to comment.
You can’t perform that action at this time.