Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6dce72f12e
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (41 sloc) 0.925 kb
<?php
/**
* Render all flash messages with EBootstrapAlert
*
* @author Tim Helfensdörfer <tim@visualappeal.de>
* @version 0.3.0
* @package bootstrap.yiiwidgets
*/
class EBootstrapFlashMessages extends EBootstrapWidget {
/**
* Init the widget
*/
public function init() {
parent::init();
}
/**
* Render the flash messages
*/
public function run() {
parent::run();
$flashMessages = Yii::app()->user->getFlashes();
if (is_array($flashMessages) and count($flashMessages)) {
echo EBootstrap::openTag('div', $this->htmlOptions);
foreach ($flashMessages as $key => $message) {
if (substr($key, 0, 5) == 'block') {
$block = true;
$key = substr($key, 6);
}
else
$block = false;
$this->widget('EBootstrapAlert', array(
'type' => $key,
'message' => $message,
'block' => $block,
));
}
echo EBootstrap::closeTag('div');
}
}
}
?>
Jump to Line
Something went wrong with that request. Please try again.