reizinixc/blogattachment 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

reizinixc/blogattachment

最新稳定版本:v1.0.0

Composer 安装命令:

composer require reizinixc/blogattachment

包简介

File attachment plugin for RainLab blog module

README 文档

README

This plugin extends the RainLab Blog plugin with file attachment features.

Plugin dependency

This plugin wants you to install RainLab Blog plugin first.

How to install

composer require reizinixc/blogattachment && echo /plugins/reizinixc/blogattachment >> .gitignore

How to use

After install this plugin, you will see the "Attachments" option in "Manage" tab.

How to attach files

If you can upload featured images, you can upload files by click the plus icon and choose the files.

How to get attached files

When you retrieve the blog post. You can get all attached files by attachments attribute e.g. posts.attachments and get attached files by iterating through attachments or use an array index.

Here are some accessible fields of attachment object.

Fields Description
content_type Get MIME type of file
created_at Get a creation datetime of file
description Get a file description
extension Get a file extension
file_name Get a file name
file_size Get a file size in Bytes
path Get a download URI of file
title Get a file title

Example usage

{% for attachment in post.attachments %}
    <a href="{{ attachment.path }}">{{ attachment.file_name }} ({{ attachment.file_size }}B)</a>
{% endfor %}

Found bugs/Translation/Enhancement

I will salute you if you create an issue or a pull request. Please feel free to do it :)

License

MIT

统计信息

  • 总下载量: 110
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固