users_controller というコントローラーがあり、getdata().getdata.ctp というアクションがそのアクションに対応するビューです。そのビューで、from data.my 問題を含む route.ctp という elemet を追加しました。getdata() メソッドでフォーム要素からすべての vaues を取得し、別のモデル Route.How we can do this? このために、要素 route.ctp にフォーム アクションを記述します。
<?php echo $this->Form->create('User', array('url' => array('action' => 'getdata'))); ?>
そして、users_controllers getdata() アクションで、私は書きます
function getdata()
{
$this->commuter(); // it call a function commuter() in this same controller for displaying some data in the view.
$this->layout='custm';
$this->loadModel('Defineroute');
if (!empty($this->data) )
{
$this->Defineroute->create(); //Defineroute is a model. in this model i want save the form date. for that i created one table "defineroutes"
$this->Defineroute->save($this->data);
}
}