yii2 flash message code example
Example 1: yii1 set flash
<?php if(Yii::app()->user->hasFlash('contact')): ?>
<div class="flash-success">
<?php echo Yii::app()->user->getFlash('contact'); ?>
</div>
<?php endif; ?>
Example 2: yii1 set flash
Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.');