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

[eluser]benoa[/eluser]
What if you do it this way?

Code:
function delete($news_id)
{
    if ($this->News_Model->delete($news_id) === TRUE)
    {
        $this->session->set_flashdata('deleted', 1);
    }
    else
    {
        $this->session->set_flashdata('deleted', 0);
    }

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

And in the view:

Code:
<?php if (isset($this->session->flashdata('deleted'))): ?>

<?php if ($this->session->flashdata('deleted')): ?>
<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;

Maybe the synthax is broken somewhere (no code highlighting in the reply textarea)... But I hope this can help!


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