class Recipe extends AppModel{
var $hasMnay = array('Ingredient');
}
-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] 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.
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4211 (20090702) __________
The message was checked by ESET NOD32 Antivirus.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment