Here a example how you can use Croogo 2.x setFlash() messages and the flash.ctp element with Bootstrap 3 alerts inclusive dismiss functionality. All Croogo controller actions use just the 'success' and / or 'error' classes for the $this->Session->setFlash() styling.

When you build your own frontend Theme you have to deal with the core setFlash() messages in Croogo, and maby you use Bootstrap 3 and want implement the full power of the BS3 alert styling. In this case we create a flash.ctp in the /View/Themed/MyCustomTheme/Elements/ and handle the given $class and $message values the right way:

	$icon = '<i class="fa fa-check-circle"></i>';

	if (strpos($class, 'success') !== false):
		$class = 'alert alert-success alert-dismissable';
	if (strpos($class, 'error') !== false):
		$class = 'alert alert-danger alert-dismissable';

<div class="<?= $class; ?>">
	<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button>
	<h4><?= $icon . ' ' . $message; ?></h4>	

The key is to overwrite the variable $class value with the BS3 css class after checking for the given 'success' or 'error'.