In IBM's tutorial (Cookup Website fast with CakePHP), I am running
into this problem.

I have two models users and products. Then there is a
hasAndBelongsToMany relation setup between users and products.

>From products_controller, I want to call an action in
users_controller.

In the code it was mentioned, to do the following:

$success = $this->Product->User->addFavorite($id);

however, cakephp looks for addFavorite somewhere in datasources.
Actually, I expect it to look in users_controller.php where I have
this action defined. So this didn't work and I tried the workaround by
requesting the action implicitly.

$success = $this->requestAction('/users/addFavorite/'.$id);

This works but gives me another problem. $this->getID()

I am not sure why cakephp complains that getID is not defined.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to