Welcome Guest, Not a member yet? Register   Sign In
Use flashdata as notifications/pop up windows
#1

[eluser]Lykos22[/eluser]
This is the main part of the posts controller
Code:
if ($this->form_validation->run() === true) {

    // store data in database and redirect
    if ($this->post_model->save() !== false) {
     $this->session->set_flashdata('post_saved', 'The post stored in database successfuly.');
    } else {
    $this->session->set_flashdata('post_fail', 'The post was not stored.');
    }
    redirect('admin/posts/post/'.$id, 'refresh');
   }

Both flashdata messages are placed inside ui-notification windows, which normally (meaning how the demo works in pure html and javascript) pops up for about 5 seconds and then fades out.

I've tested it and the notification work, the problem is that they don't fade out after 5 seconds pass. I probably guess this has to do with the flashdata, because the user guide says
Quote:"flashdata", or session data that will only be available for the next server request
.

Is there a way to make the notifications/flashdata fade out after 5 seconds?
#2

[eluser]ivantcholakov[/eluser]
No, visual effects have nothing to do with how flashdata works. For visual effects you need additional javascripts.
#3

[eluser]InsiteFX[/eluser]
If you need to keep flashdata for another round use:
Code:
$this->session->keep_flashdata('item');




Theme © iAndrew 2016 - Forum software by © MyBB