On 26/07/07, apadzik <[EMAIL PROTECTED]> wrote:
>
> ? please help, it's driving me crazy >:-( ;-))
>
I'll try.
First of all, look at your relationships.
Category has many Product
Products has many ProductSize
$product = $this->findAll(array('Product.category_id' => $c_name));
foreach($product as $p) {
$size[$p['Product']['name']] =
$this->Product->ProductSize->generateList(array('ProductSize.product_id'
=> $p['Product']['id']);
}
$this->set(compact('product', 'size'));
Then in your view, you can go through each $product and get the
information from it. To get the drop down list, use the $size array
with the name of the product that you are looking at.
Does that make sense?
I hope it does, it does in my head anyway. If you want it clarified
any more, let me know.
Mike
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---