Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.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 使用Pyro在Dir中列出文件_Php_Pyrocms_Pyro - Fatal编程技术网

Php 使用Pyro在Dir中列出文件

Php 使用Pyro在Dir中列出文件,php,pyrocms,pyro,Php,Pyrocms,Pyro,我想使用PyroCMS列出目录中的所有文件。 使用文件模块,每个客户端都有自己的文件夹,该文件夹是其用户ID \files\clients\{ID}\ 我需要这样的东西 {{ foreach file in { files:/clients/{{ user:id }} } }} <a href="{{files:current_file_name_and_ext}}">{{files:current_file_name}}</a>

我想使用PyroCMS列出目录中的所有文件。

使用文件模块,每个客户端都有自己的文件夹,该文件夹是其用户ID

\files\clients\{ID}\  
我需要这样的东西

 {{ foreach file in { files:/clients/{{ user:id }} } }} 

     <a href="{{files:current_file_name_and_ext}}">{{files:current_file_name}}</a>

{{ endif }}
{{files:/clients/{{{user:id}}}中的{foreach文件
{{endif}}

你应该能够做这样的事情

{{ files:listing folder="/files/clients/{{ client_id }}" }}
  <a href="{{ url:site }}files/clients/{{ filename }}">Download {{ name }}</a>
{{ /files:listing }}
或者甚至将当前用户与标记一起使用:

{{ user:id }}
我还没有测试过这个,但你应该可以让它运行起来

从这里开始:


http://docs.pyrocms.com/2.1/manual/index.php/modules-and-tags/tag-reference/user

谢谢,这就是我想要的。我找不到合适的文档页。干杯
{{ user:id }}