Welcome Guest, Not a member yet? Register   Sign In
Using $this in views.
#1

[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 />&lt;? echo $error_msg; ?&gt;</div>

    &lt;? } elseif(validation_errors()) { ?&gt; // login details didnt pass validation

    <div class="error"><strong>The following errors have occured:</strong><br />&lt;? echo validation_errors(); ?&gt;</div>

    &lt;? } elseif($this->session->flashdata('status')) { ?&gt; // sent from signup page to show account was created and they can login now.

    <div class="success">&lt;? echo $this->session->flashdata('status'); ?&gt;</div>

    &lt;? }else{ ?&gt;

    <div class="announce">Please Login or <a href="/signup" title="Create account">Signup</a> to continue.</div> // default message

    &lt;? } ?&gt;

In particular I'm referring to using $this->session->flashdata in the view.

Thanks.


Messages In This Thread
Using $this in views. - by El Forum - 03-30-2010, 08:38 AM
Using $this in views. - by El Forum - 03-30-2010, 09:25 AM
Using $this in views. - by El Forum - 03-30-2010, 09:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB