Php 使用Pyro在Dir中列出文件
我想使用PyroCMS列出目录中的所有文件。 使用文件模块,每个客户端都有自己的文件夹,该文件夹是其用户IDPhp 使用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>
\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 }}