diff --git a/src/Controller/Component/FlashComponent.php b/src/Controller/Component/FlashComponent.php index 92335d24d92..25f8db3226f 100644 --- a/src/Controller/Component/FlashComponent.php +++ b/src/Controller/Component/FlashComponent.php @@ -16,9 +16,11 @@ use Cake\Controller\Component; use Cake\Controller\ComponentRegistry; +use Cake\Utility\Inflector; use Cake\Error\InternalErrorException; use Cake\Event\Event; + /** * FlashComponent */ @@ -96,7 +98,7 @@ public function set($message, array $options = []) { * @throws \Cake\Error\InternalErrorException If missing the flash message. */ public function __call($name, $args) { - $options = ['element' => 'flash_' . $name]; + $options = ['element' => 'flash_' . Inflector::underscore($name)]; if (count($args) < 1) { throw new InternalErrorException('Flash message missing.');