承接 biffbangpow/silverstripe-imagesize-validator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

biffbangpow/silverstripe-imagesize-validator

最新稳定版本:v1.0.0

Composer 安装命令:

composer require biffbangpow/silverstripe-imagesize-validator

包简介

Validates the dimensions of an image during upload

README 文档

README

This extends the standard upload validator and provides additional checks on the dimensions of an uploaded image.

The validator can be applied directly to an uploadfield:

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $fields->addFieldsToTab('Root.Main', [
            UploadField::create('Image')->setValidator(PixelSizeValidator::create()),
        ]);

        return $fields;
    }

Note: the validator should only be added to upload fields where the underlying class is an Image or subclass thereof. Adding the validator to an upload field where files may be uploaded will cause any non-images to be rejected.

By default the validator will reject an image which has a pixel dimension greater than 2000 in either axis. This can be overidden in yml config, eg:

---
Name: bbppixelsizevalidator
---

BiffBangPow\Validators\PixelSizeValidator:
  max_width: 2500
  max_height: 1200

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2023-08-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固