In your model...

class Recipe extends AppModel{
        
        var $hasMnay = array('Ingredient');

}

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of heli007
Sent: Friday, 3 July 2009 12:12 p.m.
To: CakePHP
Subject: about model


   in cookbook there has something like below。i wonder how to and
where define association between model and it's main model?   main
model mean ??

---------------------------------
Associated models are available through the main model. In the
following example, Recipe has an association with the Ingredient
model.


1.  <?php
   2. class RecipeController extends AppController {
   3. function index() {
   4. $ingredients = $this->Recipe->Ingredient->find('all');
   5. $this->set('ingredients', $ingredients);
   6. }
   7. }
   8. ?>
-------------------------


__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4211 (20090702) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4211 (20090702) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to