Possible Redirect Passing value |
[eluser]napz[/eluser]
Hi guys, just wondering is it possible to pass a value to a redirect()....? I don't want to use session or flash data is that possible? thanks in advance...
[eluser]luke holder[/eluser]
if you are redirecting to another controller all you would have to do it place the variables to the controllers method in the redirect string. i.e [code[ redirect('/controllername/method/'.$var1) [/code] see redirect in the URL helper in user_guide here: http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]napz[/eluser]
[quote author="luke holder" date="1270203717"]if you are redirecting to another controller all you would have to do it place the variables to the controllers method in the redirect string. i.e [code[ redirect('/controllername/method/'.$var1) [/code] see redirect in the URL helper in user_guide here: http://ellislab.com/codeigniter/user-gui...elper.html[/quote] I already did that. however, i like to pass an array value. much like passing it on controller to view. but I want it to do in in redirect it in different class controller. hmmm.... it looks like not possible.
[eluser]nelson.wells[/eluser]
Do you have a good reason for not using flash data? This is exactly what I use flash data for.
[eluser]napz[/eluser]
[quote author="nelson.wells" date="1270256158"]Do you have a good reason for not using flash data? This is exactly what I use flash data for.[/quote] i see.... I was thinking if I will be using a flash data, it might stress or slow down the server because of too much session if there will be hundreds of user of the system. Since I just want to show some data from other controller and I dont want to change the URL. Its like this way : ----------------------------------- Controller 1 -> View 1 then I go to Controller 2(catch the value from View 1 and update something) and want to pass the value to Controller 1. (without changing the URL) -----------------------------------
[eluser]napz[/eluser]
So I think the flash data is the most likely i should use for this one |
Welcome Guest, Not a member yet? Register Sign In |