Hi, Oh, so I can not re-send the complete Page when I realise the User is not logged in!? So I will have to re-think my idea. I really thought that there is a possibility, but good that you have given a clear "No, not possible"
I have now tried something out from the IBM Tutorial, its a bit of a different issue, but I did not want to start a new post. http://www.ibm.com/developerworks/opensource/library/os-php-cake5/index.html?S_TACT=105AGX44&S_CMP=TUT They use the following: function removeFromFavorites($id) { $username = $this->Session->read('user'); $success = false; $user = $this->Product->User->findByUsername ($username, 'User.id'); $this->Product->User->id = $user['User']['id']; $success = $this->Product->User->removeFavorite($id); if ( $this->RequestHandler->isAjax() ) { echo 'Removed product from favorites'; exit; } else { if ( $success ) { $this->Session->setFlash('Removed product from favorites'); $this->redirect('/users/favorites'); } else { $this->Session->setFlash('Access denied'); $this->redirect('/products/index'); } } } I have tried this out to understand the structure behind it but get Query: removeFavorite So it must be the below line, but what is the issue with this code? Why is it using the method as a query? $success = $this->Product->User->removeFavorite($id); I can't see what is wrong. Anyone an idea? Thanks so much in advance. Luke --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
