Displaying a message on the page after certain action |
[eluser]cinewbie81[/eluser]
Hi, I download the updated session library from http://bleakview.orgfree.com/dl/Version_...ssion.phps when i load the library from my controller it generate me the error : The session timeout configuration is invalid. I've never use session b4, and i dont really know how it works ... did I miss something ?
[eluser]Derek Allard[/eluser]
I can't help you with obsession, but I actually wrote a whole blog post about the new CI session library, including how to get it, and what you need to do to make it work. http://www.derekallard.com/blog/post/enh...n-library/
[eluser]cinewbie81[/eluser]
Hi Derek, thoughts obsession is the same with the session library !! I'll have a look at your blog post .. Will keep u updated .. and thanks for that !!
[eluser]cinewbie81[/eluser]
Ok this is what i did : 1) replace the session.php file - get the modified one from http://dev.ellislab.com/svn/CodeIgniter/...ession.php 2) in my controller file, i load the session library 3) After certain action performed, i has something like: Code: $this->session->set_flashdata('msg', 'Record Added Successfully'); 4) In my view file i have something like : Code: <div id="actionMessage"> There's no error... but then it didn't generate me any flash data as well ? What did I missed ?? Do I need to set anything in config file ?
[eluser]Derek Allard[/eluser]
if you're settin git and then displaying it in the same load, the flash var doesn't really consider it a new page. try Code: <?php
[eluser]Lone[/eluser]
Ill just confirm that we just replaced the Sessions Class file to a 1.5.4 install with no problemos at all. cinewbie81: I think you perception of how flashdata works might be wrong. As far as I can tell it is best used for a page redirect - here is a quick sample: 1. You have a blog comment form that a user fills out and is submitted and run through a controller function which is then redirected to the viewComments controller function. Code: function addComment() 2. The viewComments page is then loaded with all of the comments and the message at top Code: function viewComments() In the View you would then output the message using $msg Hope this makes sense as its hard to explain without a full code sample :-S
[eluser]cinewbie81[/eluser]
Ok guys, it's working now .. Thanks a lot .. just another question , is that possible for me to make the flash msg animated ?? If so where should i start ??
[eluser]wemago[/eluser]
jquery, scriptaculous or mootools choose one of them. i'm used to scriptaculous and if you see their examples, you'll see that there's an perfect effect for this and very easy to use -> fade out ![]()
[eluser]cinewbie81[/eluser]
Sorry One more question, Is that possible for us to pass a parameter of the message type in set_flashdata function ? for example : $this->session->flashdata('msg', 'error') or $this->session->flashdata('msg', 'info') I need to display different message type with different color ..
|
Welcome Guest, Not a member yet? Register Sign In |