Is there a way to change a $_GET variable while using $this->render(‘view’) in a controller? I can use $this->redirect to do what I am trying to do (reload the page with no $_GET variable), but then I cannot pass $_POST data, which is less than optimal. Or is there something I’m missing?
This code piece for the pagination aims to pass the parameter from POST to GET at first time (on the 1st page), and to use the parameter from GET at the next time (after the 2nd page).
Hmm, possibly. Maybe I’m just doing this the completely wrong way. Here’s what I’m trying to do: I have a view with a form, and I want to intially show the form with all fields disabled. If the user clicks an ‘edit’ link, the disabled attribute is removed from all fields.
If I call $this->render(…) instead of $this->redirect($url), the $_GET variable stays set. If I call $this->redirect($url), the $_GET variable disappears, but then I can’t (or don’t know how to) pass the ‘status’ variable (the $status variable will trigger a message telling users whether the save was successful or not) - unless, there’s a way to make that display if the model doesn’t have any error messages.
Or maybe the way I’m doing this is just making it a lot more complicated than it needs to be
I suppose that would pass it, but then I’ve got a mess of a URL to look at but then again, the average user probably doesn’t even know what a URL is or care how pretty it is, so…