Yii Flash Messages

Here I added the source code to show the flash message. We can show single or multiple messages in yii flash method.

//Set Flash Message
Yii::app()->user->setFlash('success', "Row Inserted Successfully");
//Get And Display Message
// For Single Flash Message
if(Yii::app()->user->hasFlash('success')): ?>
    <div class="info">
        <?php echo Yii::app()->user->getFlash('success'); ?>
<?php endif;?>

// Multiple Message
foreach(Yii::app()->user->getFlashes() as $key => $message) 
    if ($key=='counters')
    echo "<div class='flash-{$key}'>{$message}</div>";