Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cakephp 通过Ajax黑洞添加字段_Cakephp - Fatal编程技术网

Cakephp 通过Ajax黑洞添加字段

Cakephp 通过Ajax黑洞添加字段,cakephp,Cakephp,我有一个表单,它可以更新表中的多个记录,并且工作正常。我也希望能够通过ajax添加新记录。我通过ajax加载了以下内容,但是我被黑了 <? $uuid = String::uuid(); ?> <tr> <?=$this->Form->input('Attachment.'.$uuid.'.id',array());?> <?$this->Form->unlockField('Attachment.'.$uuid

我有一个表单,它可以更新表中的多个记录,并且工作正常。我也希望能够通过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>

有人知道是什么导致了这一切吗

谢谢

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

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

$this->Security->unlockedActions
在您的beforeFilter中