$this->Js->submit を使用して値をコントローラーに非同期的に渡し、div (id = #upcoming) を更新しています。どういうわけか、コントローラーに渡されるフィールド 'test' の値を保存/取得できません。Firebug は、正しい値が渡されたことを教えてくれます。私は何を間違っていますか?
ファイルを表示 (playlist.ctp):
echo $this->Form->create('Add', array('url' => array('controller' => 'Gods', 'action' => 'add')));
echo $this->Form->input('test');
echo $this->Js->submit('Addddd', array(
'url' => array(
'controller' => 'Gods',
'action' => 'add'
),
'update' => '#upcoming'
));
echo $this->Form->end();
echo $this->Js->writeBuffer(array('inline' => 'true'));
コントローラーのアクション:
public function add()
{
$this->autoLayout = false;
$this->layout = 'ajax';
$link = $this->request->data['Add']['test'];
$this->set('test',$link);
}
そしてそのビューファイル (add.ctp):
<?php
echo $test;
?>
ご協力いただきありがとうございます!