openclassify/vendor/anomaly/files-module/docs/en/04.reference/02.plugin.md
Mostafa Moradi cd80f0352b initial
2022-03-09 12:57:37 +03:00

732 B

title
Plugin

Plugin

Files

file

The file function returns a decorated file instance by identifier. The parameter can be a file location, path, or id.

{{ file(1).name }}
{{ file('images/foo.jpg').name }}
{{ file('local://images/foo.jpg').name }}

{{ file('local://images/foo.jpg').make.fit(100, 100).inline|raw }}

Folders

folder

The folder function returns a decorated folder instance by identifier. The parameter can be a file slug or id.

{{ folder(1).name }}
{{ folder('images').name }}

{% for file in folder('images').files %}
    <a href="{{ file.route('download') }}">Download {{ file.name }}</a>
{% endfor %}