Welcome Guest, Not a member yet? Register   Sign In
Flashdata boolean gets converted between requests
#1

[eluser]mawe[/eluser]
Hi all!

The topic pretty much says it all. I have this in a controller:
Code:
function delete($news_id)
{
    if ($this->News_Model->delete($news_id) === TRUE)
    {
        $this->session->set_flashdata('deleted', TRUE);
    }
    else
    {
        $this->session->set_flashdata('deleted', FALSE);
    }

    redirect(base_url().'admin/news/archive', 'location');
}

In the archive view I had this:
Code:
<?php if ($this->session->flashdata('deleted')): ?>

<?php if ($this->session->flashdata('deleted') === TRUE): ?>
<p class="success">News gelöscht!</p>
&lt;?php else: ?&gt;
<p class="error">News konnte nicht gelöscht werden!</p>
&lt;?php endif; ?&gt;

&lt;?php endif; ?&gt;

The inner if (the one that checks for TRUE) doesn't work. I examined the session and the flashdata item is actually '1', a string, not boolean TRUE.

Is this expected behaviour?


Messages In This Thread
Flashdata boolean gets converted between requests - by El Forum - 05-11-2009, 02:24 PM
Flashdata boolean gets converted between requests - by El Forum - 05-11-2009, 02:27 PM
Flashdata boolean gets converted between requests - by El Forum - 05-11-2009, 02:37 PM
Flashdata boolean gets converted between requests - by El Forum - 05-20-2009, 01:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB