2

In our application, we have certain scenarios where we'd like to perform a redirect and pass a long string to the next controller/action. I'm familiar with both of these:

$this->_redirect('/controller/action?string=thisistheverylongstring);

But would like to avoid showing the user the string as part of the URL.

Throwing the string in $this->view doesn't help because after a redirect, a new request is created.

As far as I know, using $this->_helper->redirector() has the same problem.

1 Answer 1

4

I'm not super familiar with ZF's controller system so I can't give you a bespoke recommendation.

Is using a session value out of the question? Another popular framework, symfony, uses what they call "flash" variables which are session values that survive for only 1 more request.

I'm sure you could do something similar with ZF.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the info. There is a FlashMessenger class in ZendFramework. framework.zend.com/manual/en/…
Well awesome. Glad my answer pointed you in the right direction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.