Re: Help for begginer.. problem with retrieving data from two models in one controller

2007-07-26 Thread Mithun Das
Try use requestAction() and pass ur required paramameters through $pass array within the action The syntax is requestAction($fieldname/$controller_function, $pass=(array())); On 7/25/07, apadzik <[EMAIL PROTECTED]> wrote: > > > Hi! I'm a beginner in Cake and can't understand one thing, maybe you

Re: Help for begginer.. problem with retrieving data from two models in one controller

2007-07-26 Thread apadzik
Thank you very much Mike:-)) Your answer does of course make sense a lot;-)) Unfortunately, I checked your post after solving the problem, so maybe I will use your solution somewhere else;)) I finally did it by product_productsizes hABTM relation table (because products can have many sizes, as wel

Re: Help for begginer.. problem with retrieving data from two models in one controller

2007-07-26 Thread Mike Griffin
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

Re: Help for begginer.. problem with retrieving data from two models in one controller

2007-07-26 Thread apadzik
? please help, it's driving me crazy >:-( ;-)) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send em

Re: Help for begginer.. problem with retrieving data from two models in one controller

2007-07-25 Thread Wimg
maked On Jul 25, 5:37 pm, apadzik <[EMAIL PROTECTED]> wrote: > Hi! I'm a beginner in Cake and can't understand one thing, maybe you > more experienced people will know the solution:-) > So, I have two tables in db: products (id,name) and productsizes > (id,product_id,size); > Two models: Product,

Re: Help for begginer.. problem with retrieving data from two models in one controller

2007-07-25 Thread apadzik
Thank's for answer and tip about the $c_id:) Ok, but how can I usa that generateList function if I don't have $product_id parameter? As I said I want to display all products from categories on one page, so my display action only handles category_id parameter, not product_id parameter. I tried the

Re: Help for begginer.. problem with retrieving data from two models in one controller

2007-07-25 Thread Grant Cox
$size_list = $this->ProductSize- >generateList( array('ProductSize.product_id' => $product_id ); But a couple of notes. You can probably get what you want by just setting $this->Product->recursive = 1; before the findAllByCategoryId line. You can also improve the $c_id= line, to $c_id = $this->

Help for begginer.. problem with retrieving data from two models in one controller

2007-07-25 Thread apadzik
Hi! I'm a beginner in Cake and can't understand one thing, maybe you more experienced people will know the solution:-) So, I have two tables in db: products (id,name) and productsizes (id,product_id,size); Two models: Product, Productsize; product.php: class Product extends AppModel { var