I'd put the method in RecipesController. Just grab the user_id from
the session (or Auth). Or, if you want people to be able to see other
users' recipes:
function yourAction($user_id = null)
{
if (is_null($user_id))
{
$user_id = $this->Auth->user('id');
}
...
}
On Wed, Jul 8, 2009 at 11:16 AM, Luke<[email protected]> wrote:
>
> Hi,
>
> I am developing a small recipe site, this is my first cakePHP project.
> I now have a structual question.
>
> You have to register and log in to add a recipe. So in the recipe
> table will be your user_id. You can also save recipes in your
> cookbook. To see your saved and your own recipes, you have to log in
> into your I call it "mybox".
> Question now, I want to display a list of your own recipes as well as
> your saved recipes in your mybox.
>
> Do I now create a mybox controller which reads out the recipe table
> for your own recipes and read out the mybox table or do i actually add
> a function in the user controller to read out the mybox and recipe
> table?
>
> Means, does mybox belongs to the User_controller and I dont create a
> seperate controller or should I treat it seperate?
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---