[eluser]Sayian[/eluser]
Hi,
Is there anything wrong with doing the following in views?
Code:
<? if(isset($error_msg)) { ?> // assigned from controller if login error
<div class="error"><strong>The following errors have occured:</strong><br /><? echo $error_msg; ?></div>
<? } elseif(validation_errors()) { ?> // login details didnt pass validation
<div class="error"><strong>The following errors have occured:</strong><br /><? echo validation_errors(); ?></div>
<? } elseif($this->session->flashdata('status')) { ?> // sent from signup page to show account was created and they can login now.
<div class="success"><? echo $this->session->flashdata('status'); ?></div>
<? }else{ ?>
<div class="announce">Please Login or <a href="/signup" title="Create account">Signup</a> to continue.</div> // default message
<? } ?>
In particular I'm referring to using $this->session->flashdata in the view.
Thanks.