Skip to content

Commit

Permalink
Inflect element name to underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
bcrowe committed Jun 7, 2014
1 parent a5a5eb4 commit 65794d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Controller/Component/FlashComponent.php
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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.');
Expand Down

0 comments on commit 65794d1

Please sign in to comment.