Hi John,
Shame, but thanks a lot. I think I will really need the option to have
a recipe in more than 1 category. I will probably allow up to 2
categories.
Where I now just struggle with is that I am trying to read out all the
recipes which belong to a subcategory.
So I clicked on BBQ and than on Beef. Now I should get a list of all
the recipes. I would have to read out the DB table
recipes_subcategories to get all the recipe id's of all the recipes
from that subcategory and than read out the information from the
recipe table (At least the recipe name and the id) to create an
overview of all the available recipes.
So in my RecipesController I have add:
$this->set('recipes', $this->Recipe->RecipesSubcategory->find
('all',array('conditions' => array('subcategory_id' => $id))));
In my view I get this now. Great, but how do I now get the connection
to the recipe table at the same time?
Array
(
[0] => Array
(
[RecipesSubcategory] => Array
(
[recipe_id] => 28
[subcategory_id] => 49
)
)
[1] => Array
(
[RecipesSubcategory] => Array
(
[recipe_id] => 29
[subcategory_id] => 49
)
)
[2] => Array
(
[RecipesSubcategory] => Array
(
[recipe_id] => 31
[subcategory_id] => 49
)
)
)
On 1 Jun., 13:41, John Andersen <[email protected]> wrote:
> Disregard my mail! Not usesful solution, if your receipe can belong to
> more than one category!
> John
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---