Definitely helps. Generally speaking though, do you could an else statement in regardless if it doesn't need the view or message setting just for styles sake?
2007/5/10, Gonzalo Servat <[EMAIL PROTECTED]>: > > > On 5/10/07, Greg Cerveny <[EMAIL PROTECTED]> wrote: > > > > Which is better? > > > > if ($this->User->save($this->data)){ > > $this->flash('Password updated, please login > again.','/users/logout'); > > } else { > > $this->render(); > > } > > > > or just: > > > > if ($this->User->save($this->data)){ > > $this->flash('Password updated, please login > again.','/users/logout'); > > } > > > > It seems to have the same functionality. > > It'll have the same functionality as long as there is no error saving the > user data. If there is an error saving the data to the DB (for whatever > reason that may be), the user will see whatever view corresponds to the > action you're calling without an error message, so I would suggest if you're > going to do that, you do a setFlash first to let the user know that their > new password was not updated. > > Hope this helps. > > Regards, > Gonzalo > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---