Welcome Guest, Not a member yet? Register   Sign In
Using (@) error suppression on Undefined Variables
#5

[eluser]bigtony[/eluser]
[quote author="Gwarrior" date="1252592242"]Can you reference session data from a view or do you have to pass it down through a variable?[/quote]
Yes, you can reference it in a view, something like this:
Code:
<body>
    <p>
        &lt;?php if ($this->session->userdata('logged_in') == TRUE): ?&gt;
            You are logged in
        &lt;?php else: ?&gt;
            You are NOT logged in
        &lt;?php endif; ?&gt;
    </p>
&lt;/body&gt;


Messages In This Thread
Using (@) error suppression on Undefined Variables - by El Forum - 09-10-2009, 12:00 AM
Using (@) error suppression on Undefined Variables - by El Forum - 09-10-2009, 01:43 AM
Using (@) error suppression on Undefined Variables - by El Forum - 09-10-2009, 03:07 AM
Using (@) error suppression on Undefined Variables - by El Forum - 09-10-2009, 03:17 AM
Using (@) error suppression on Undefined Variables - by El Forum - 09-10-2009, 03:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB