アットウィキロゴ

カテゴリのモデルを作る


>cd "c:\Program Files\xampp\htdocs"
>..\php\php cake\scripts\bake.php -app blog

 ___  __  _  _  ___  __  _  _  __      __   __  _  _  ___
|    |__| |_/  |__  |__] |__| |__]    |__] |__| |_/  |__
|___ |  | | \_ |___ |    |  | |       |__] |  | | \_ |___
---------------------------------------------------------------



Baking...
---------------------------------------------------------------
Name: blog
Path: C:\Program Files\xampp\htdocs\blog
---------------------------------------------------------------
[M]odel
[C]ontroller
[V]iew

What would you like to Bake? (M/V/C)
>M

---------------------------------------------------------------
Model Bake:
---------------------------------------------------------------
Possible models based on your current database:
1. Category
2. Comment
3. Post

Enter a number from the list above, or type in the name of another model.
>1 ←カテゴリを作成

~値チェックはデフォルトのまま進む(省略)~

Would you like define model associations ([[hasMany]], [[hasOne]], belomgsTo, etc.)?(y/n)
[y]>y 関連を作成
One moment while I try to detect any assiciations...
Done.
----------------------------------------------------------------
Please confirm the following associations:
----------------------------------------------------------------
Category hasOne Post?(y/n)
[y]>n ←カテゴリから投稿は1つではないので「n」を指定。

Category hasMany Post?(y/n)
[y]>y ←カテゴリから投稿は複数なので「y」を指定。

Would you like to define some additional model associations?(y/n)
[y]>n ←これ以上の関連はないので「n」を指定。

 これ以降は以前と同様に、内容を確認してよければ進んで、単体テストは作らない。また、作成するものが多いので、以降はデフォルト以外の入力値を追っていく。
最終更新:2007年05月15日 19:04