olivierbon/craft-squeeze

动态打包一个或多个craft资源,以便前端用户下载。

1.1.2 2019-05-30 09:38 UTC

This package is auto-updated.

Last update: 2024-09-29 05:02:23 UTC


README

动态打包一个或多个craft资源,以便前端用户下载。

要求

此插件需要Craft CMS 3.0.0-RC11或更高版本。

安装

转到您项目控制面板的插件商店,搜索“Squeeze”。然后在模态窗口中点击“安装”按钮。

用法

<form method="post" target="_blank">
    {{ csrfInput() }}
    {{ actionInput('squeeze/download') }}
    <input type="hidden" name="archivename" value="archive">
    <input type="checkbox" name="files[]" value="10"><!-- asset id -->
    <input type="checkbox" name="files[]" value="20"><!-- asset id -->
    <input type="submit" value="Download!">
</form>

要触发通过url的下载,可以使用

/actions/squeeze/download?archivename=archive&files[]=10&files[]=20

致谢

图标由Yazmin Alanis从Noun Project提供。此插件主要是Bob的zipassets的移植。