jshelperでファイルをアップロードしようとしています。
私からしてみれば:
<?php echo $this->Form->create('Form', array(
'inputDefaults' => array(
'format' => array('before', 'error', 'label', 'between', 'input', 'after'),),
'enctype' => 'multipart/form-data'
));
echo $this->Form->input('Form.file', array('type' => 'file', 'id'=>'file'));
$this->Js->get('#file')->event(
'update',
$this->Js->request(
array('controller' => 'ControllerForm','action' => 'actionForm'),
array(
'async' => true,
'method' => 'post',
'dataExpression'=>true,
'data'=> $this->Js->serializeForm(array(
'isForm' => false,
'inline' => true,
))
)
));
echo $this->Js->writeBuffer();
echo $this->Form->end();
?>
私のコントローラーで:
public function actionForm(){
debugger::dump($this->data);
}
ただし、debugger::dump
空の配列を出力します。