[]Cake.php

データの渡し方で少し躓いたから、書いておく。

index.ctp から、
add.cpt へフォームを使ってデータを渡す時、

index.ctp では、Testのテーブルに値を入れるときに、
echo $form->create(null,array('type'=>'post','action'=>'./add'));
echo $form->hidden('Test.id',array( 'value' => '1' ));
echo $form->hidden('Test.flag',array( 'value' => '1' ));
echo $form->submit("フラグ立てて追加");
echo $form->end();
とかにして、

add.ctp では、controller内で、下記のようにする。
※Test2のテーブルの項目を、Testのテーブルを追加すると同時に、
同一ページに表示させる場合、data['Test']['id']←ここに躓いた。( ' つけてなかった)
function add() {
if (!empty($this->data)) {
$id = $this->data['Test']['id'];
$this->set('data', $this->Test2->read(null, $id));

$this->Test->create();
if ($this->Test->save($this->data)) {
$this->Session->setFlash(__('The mk user accept has been saved', true));
} else {
$this->Session->setFlash(__('The mk user accept could not be saved. Please, try again.', true));
}
}
}