Correct approach - single page controllers?
Permalink 1 user found helpful
** Edit: Got it, needed to redirect to another "save_complete" method, set the message there, and the view is always updated with the saved value **
Think I'm going wrong here.
I have a simple form, which retrieves and saves user attributes.
When I save I get some odd behaviour, like it retrieves the attribute to display on the form before it is updated.
If I do the below it sorts it, but the question is should I need to. This code is all in the on_start method of the single page controller.
Expected to just be able to do this
I can also redirect, back to the default view and that sorts it. But then I lose my $message output.
Help appreciated.
Think I'm going wrong here.
I have a simple form, which retrieves and saves user attributes.
When I save I get some odd behaviour, like it retrieves the attribute to display on the form before it is updated.
If I do the below it sorts it, but the question is should I need to. This code is all in the on_start method of the single page controller.
if($_POST){ $this->set('myDomain',$_POST['mydomain']); } else { $this->set('myDomain',$ui->getAttribute('my_domain')); }
Expected to just be able to do this
$this->set('myDomain',$ui->getAttribute('my_domain'));
I can also redirect, back to the default view and that sorts it. But then I lose my $message output.
Help appreciated.