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
Php 为JS模板[blueimp/jQuery文件上传]添加价值的热门工具_Php_Javascript_Jquery - Fatal编程技术网

Php 为JS模板[blueimp/jQuery文件上传]添加价值的热门工具

Php 为JS模板[blueimp/jQuery文件上传]添加价值的热门工具,php,javascript,jquery,Php,Javascript,Jquery,我对jQuery文件上传(blueimp)有意见 上传文件时,我将文件数据插入数据库。在这之后,我可以得到最后一个insert id。问题是:如何将这个值从PHP传输到JavaScript模板 更清楚地说,我需要如下模板: <script id="template-download" type="text/x-tmpl"> {% for (var i=0, file; file=o.files[i]; i++) { %} <div class="templat

我对jQuery文件上传(blueimp)有意见

上传文件时,我将文件数据插入数据库。在这之后,我可以得到最后一个insert id。问题是:如何将这个值从PHP传输到JavaScript模板

更清楚地说,我需要如下模板:

<script id="template-download" type="text/x-tmpl">
   {% for (var i=0, file; file=o.files[i]; i++) { %}
      <div class="template-download fade" id="file-{%=file.id%}">
         <div class="name"><span>{%=file.name%}</span></div>
         ....
      </div>
   {% } %}
</script>

然后我们可以在模板中使用
file.myvar

我有一些额外的表单数据,我很幸运地将它们添加到函数
handle\u file\u upload

$file = new stdClass();
$file->name = $this->trim_file_name($name, $type, $index);
$file->size = $this->fix_integer_overflow(intval($size));
$file->type = $type;
//add additional post variables here:
$file->title = $_POST['title'][$index];
$file->description = $_POST['description'][$index];

我有一些额外的表单数据,我很幸运地将它们添加到函数
handle\u file\u upload

$file = new stdClass();
$file->name = $this->trim_file_name($name, $type, $index);
$file->size = $this->fix_integer_overflow(intval($size));
$file->type = $type;
//add additional post variables here:
$file->title = $_POST['title'][$index];
$file->description = $_POST['description'][$index];