My problem here was that I wanted to call a view, which depended on a
variable. As the redirect was clearing the variable, the display of
the view failed. I solved by (i) calling the view function [including
the $id of the record I wanted to view] and (ii) rendering the view.
By calling the function all variables needed by the view are prepared
by the the view function in the controller and rendering the view
displays it as expected. For full details see here:
http://www.jeremy-burns.co.uk/2009/12/cakephp-adding-a-delete-confirm-function/

On Dec 5, 9:16 am, Jeremy Burns <jeremybu...@me.com> wrote:
> Thanks for the tip. That isn't in the docs (although it is in the
> API). Regrettably, that doesn't work either - it is clearing the
> variables. However, I solved this issue now (very simply and
> elegantly) and am in the process of writing up my solution, which I'll
> post back here).
>
> On Dec 4, 5:49 pm, Miles J <mileswjohn...@gmail.com> wrote:
>
>
>
> > Well of course, its another HTTP request and a complete new page load.
> > If you want toredirectit to another action, use setAction().
>
> > On Dec 4, 7:24 am, euromark <dereurom...@googlemail.com> wrote:
>
> > > of course it does
>
> > > variables in a script are always for that "session" only
> > > aredirecteven to the same url starts the whole process again
>
> > > use session, file cache, or pass them with yourredirecturl
> > > (depending on the kind of information and how much it is)
>
> > > On 4 Dez., 13:59, Jeremy Burns <jeremybu...@me.com> wrote:
>
> > > > I am setting a variable using $this->set('name', value), and then
> > > > redirecting the user to a different page using $this->redirect(array
> > > > ('action' => 'index'), null, true);. The variable $name is no longer
> > > > recognised. Does aredirectclearthe set variables? If so, how can I
> > > > pass the variable along to be used after aredirect?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to