0

我有一个表格可以更新表格中的多个记录并且工作正常。我也希望能够通过 ajax 添加新记录我正在通过 ajax 加载以下内容但我被黑洞

<?
$uuid = String::uuid();
?>

<tr>
    <?=$this->Form->input('Attachment.'.$uuid.'.id',array());?>
    <?$this->Form->unlockField('Attachment.'.$uuid.'.id');?>
    <td><?=$this->Form->input('Attachment.'.$uuid.'.title',array('label'=>false,'style'=>'float:left;'));?></td>
    <?$this->Form->unlockField('Attachment.'.$uuid.'.title');?>
    <td><?=$this->Form->input('Attachment.'.$uuid.'.url',array('label'=>false,'style'=>'float:left;'));?> <button onclick="return false;" class="btn attachment_select_file" style="float:left;"><i class="icon-folder-open"></button></i></td>
    <?$this->Form->unlockField('Attachment.'.$uuid.'.url');?>
    <td><button class="btn"><i class="icon-trash icon-large"></i></button></td>
</tr>

有谁知道可能导致这种情况的原因。

谢谢

4

1 回答 1

0

“在某些情况下,您可能希望禁用某个操作的所有安全检查(例如 ajax 请求)。您可以通过在 beforeFilter 中的 $this->Security->unlockedActions 中列出这些操作来“解锁”这些操作。” - 来自烹饪书

我要做的第一件事是完全禁用安全组件并查看是否可以修复它。如果是,则重新启用安全组件,并将相关操作添加到

$this->Security->unlockedActions

在您的 beforeFilter 中。

于 2013-05-16T09:03:03.973 回答