Welcome Guest, Not a member yet? Register   Sign In
Help with calling views [FIXED]
#1

[eluser]NachoF[/eluser]
Say I have a method called delete_piece(), that gets called through the url mycontroller/delete_piece/2 (or any number)... but i have links to that method on different parts(views) of my site, and I want the controller to perform the actions (delete and stuff) and then load the view that called the method in the first place... how would you go about doing that?? help please.
#2

[eluser]jedd[/eluser]
Hi NachoF and welcome to the CI forums.

You might want to look at using flashdata.

Have a read about it in the [url="http://ellislab.com/codeigniter/user-guide/libraries/sessions.html"]Sessions page[/url] of the CI manual - it's about 2/3 of the way down that page.

You could either update the flash data on pages where you know you might send the user off to do this delete method (for instance) or else you could set the flash data on all your pages - and then the delete method could test to see if the flash data exist, and if it does it will redirect the user back to where they came from.

Does that make sense?
#3

[eluser]NachoF[/eluser]
Interesting, Im gonna try that and report.... also, codeigniter is the best thing ever Smile
#4

[eluser]NachoF[/eluser]
Yes, that worked beatifully... thanks man




Theme © iAndrew 2016 - Forum software by © MyBB