title: How to set a flash message in Yii2?
body: <p>i followed this <a href="https://stackoverflow.com/questions/29382849/how-i-use-flash-message-in-yii2">Link</a>. My code is as follows
  in controller</p>
  
  <pre><code>public function actionFunction4()
      {
          $this-&gt;layout="sintel";
          $model= new Customers();
          \Yii::$app-&gt;getSession()-&gt;setFlash('success', 'successfully got on to the payment page');
          return $this-&gt;render("function4",['model'=&gt;$model]);
      }
  </code></pre>
  
  <p>in the view</p>
  
  <pre><code> &lt;div id="message"&gt;
  
            &lt;?= Yii::$app-&gt;session-&gt;getFlash('success');?&gt;
        &lt;/div&gt;
  </code></pre>
  
  <p>now the result of what i did is not what i expected. I got a message "successfully got on to the payment page" like i have echo ed it. If it is similar to echo then why do we need a flash message in Yii2. I think i may be missing something in my code that make my flash message appear like a regular one. </p>