![]() |
Displaying a message on the page after certain action - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Displaying a message on the page after certain action (/showthread.php?tid=5127) Pages:
1
2
|
Displaying a message on the page after certain action - El Forum - 01-07-2008 [eluser]cinewbie81[/eluser] Hi all, I want my system to display a message after certain action been executed. For eg: 'System user has been deleted' - This is so user knows that the action was executed Can I do it something like CI Form Validation error message ? IF so then how can i do it ? Displaying a message on the page after certain action - El Forum - 01-07-2008 [eluser]Phil Sturgeon[/eluser] Just make a REALLY simple view called message.php. Then have two variables inside it, like this: Code: <p><?=$message;?></p> These variables can be defined each time you want to show a message. For example in your controller if something works, redirect it to a success page. Code: function success(){ You will of course need to include your layout (header and footer) however you handle that. Use YATS or whatever. There are many more complex methods of doing it but this is a nice quick one. Displaying a message on the page after certain action - El Forum - 01-07-2008 [eluser]cinewbie81[/eluser] Hi thepyromaniac, your methos will definitely works.. Anyway, what i want is something like Form Validation Error Message. When an action is performed, the message will display somewhere on top of the page of the form, instead of load another view file (if you get what i mean) Displaying a message on the page after certain action - El Forum - 01-07-2008 [eluser]wemago[/eluser] if i get what you want, you can do it using sessions flash messages, see latest updates on svn for CI. Code: if ( action fail ) on the location you want/redirect, you just need Code: if ( isset( flashmsg ) ) and if you want it a bit more good looking just add a bit of javascript fade out effect ![]() Displaying a message on the page after certain action - El Forum - 01-07-2008 [eluser]cinewbie81[/eluser] wemago, I check on this url: http://bleakview.orgfree.com/obsession/ Yes, that's exactly what i want .. but, my current application doesnt use session ... instead i use cookie for login etc ... what should i do now ? and i dont know where to get the latest code for Codeigniter SVN Displaying a message on the page after certain action - El Forum - 01-07-2008 [eluser]Derek Allard[/eluser] Hey cinewbie81. I got just what the doctor ordered ![]() http://www.derekallard.com/blog/post/checking-codeigniter-out-of-the-subversion-repository/ Flash vars definately sound like what you want. Displaying a message on the page after certain action - El Forum - 01-08-2008 [eluser]cinewbie81[/eluser] Having some problem to get those files using SVN... it prompt me for username and password .. anyway, I manage to found the file from http://svn.kohanaphp.com/trunk/system/libraries/ I suppose it's only the session file that's needed to be replace in this case right ?? Displaying a message on the page after certain action - El Forum - 01-08-2008 [eluser]wemago[/eluser] yes its only the session file you need. if you use tortoisesvn in windows, should work out the box. follow master Dereks steps and should just work fine ![]() Displaying a message on the page after certain action - El Forum - 01-08-2008 [eluser]xwero[/eluser] You find the solution for connecting to the svn in the comments of the blogpost. Displaying a message on the page after certain action - El Forum - 01-08-2008 [eluser]Derek Allard[/eluser] cinewbie81, I'd strongly encourage you to use the CI session files - I'm not sure about compatibility with other libraries. |