seppzzz/zipable-dataobjects
Composer 安装命令:
composer require seppzzz/zipable-dataobjects
包简介
This module adds a link (Button) to DataObjects to zip em and download on the fly
README 文档
README
create .zip files from dataobjects on the fly with textfile and images
Requirements
- SilverStripe 4 (tested with 4.11 and up)
Installation
Installation is supported via composer only
composer require seppzzz/zipable-dataobjects
Documentation
config.yml :
YourDataObject:
extensions:
- seppzzz\ZipableDataObjects\ZipableDataObject
On your Dataobject :
dont change the keys 'Textfields' and 'Images'.
create as many textfields in 'Textfields' - array as needed.
with 'Images' array point to your Image - Object
public function createZipableFields()
{
$fields = [
'Textfields' => [
'Title' => $this->Title,
'Subtitle' => $this->SubTitle,
'Content' => $this->Content
],
'Images' => $this->Images()
];
return $fields;
}
In your template :
<% if $getDownloadLink %>
<a href="$getDownloadLink" class="btn btn-primary zipDownloadButton">Download ZIP</a>
<% end_if %>
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-only
- 更新时间: 2023-09-23