title: how to check session flashdata in helper in CI
body: <p>To check and display a session, I usually do this:</p>
  
  <pre><code>        $alert = $this-&gt;session-&gt;flashdata('alert');
  
          if($alert)
          {
              ?&gt;
              &lt;div class="alert alert-info alert-dismissible" role="alert"&gt;
                  &lt;button type="button" class="close" data-dismiss="alert"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt;
                  &lt;?php echo $var; ?&gt;
              &lt;/div&gt; &lt;?php
          }
  </code></pre>
  
  <p>But the result is sloppy. I want to make a "ECHO" of a function and that function contains everything you need to check and display the session. So I try to do this in form helper:</p>
  
  <pre><code>function errors_session()
  {
     $ci =&amp; get_instance();
  
     if( $this-&gt;ci-&gt;session-&gt;flashdata() == TRUE )
     {
        return '&lt;div class="error"&gt;'. $this-&gt;ci-&gt;session-&gt;flashdata() .'&lt;/div&gt;';
     }
  
     return '';
  }
  </code></pre>
  
  <p>but this not work</p>